rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes
StepperHw Class Referenceabstract

#include <stepper.h>

Inheritance diagram for StepperHw:
Inheritance graph
[legend]
Collaboration diagram for StepperHw:
Collaboration graph
[legend]

Public Member Functions

virtual bool step (bool positive)=0
 
void pause (int divisor=1) const
 
virtual void sleep ()
 

Protected Member Functions

void setReactionTime (float ms)
 

Private Attributes

float m_reactionTime = 5.0f
 

Detailed Description

Definition at line 15 of file stepper.h.

Member Function Documentation

◆ pause()

void StepperHw::pause ( int  divisor = 1) const

Definition at line 197 of file stepper.cpp.

197 {
198 // currently we can't sleep less than 1ms (see #3214)
199 chThdSleepMicroseconds(maxI(MS2US(1), (int)(MS2US(m_reactionTime)) / divisor));
200}
float m_reactionTime
Definition stepper.h:27

Referenced by StepperMotorBase::doIteration(), StepDirectionStepper::pulse(), StepDirectionStepper::setDirection(), sleep(), DualHBridgeStepper::sleep(), and DualHBridgeStepper::step().

Here is the caller graph for this function:

◆ setReactionTime()

void StepperHw::setReactionTime ( float  ms)
protected

Definition at line 202 of file stepper.cpp.

202 {
203 m_reactionTime = std::max(1.0f, ms);
204}

Referenced by StepDirectionStepper::initialize(), and DualHBridgeStepper::initialize().

Here is the caller graph for this function:

◆ sleep()

void StepperHw::sleep ( )
virtual

Reimplemented in DualHBridgeStepper.

Definition at line 193 of file stepper.cpp.

193 {
194 pause();
195}
void pause(int divisor=1) const
Definition stepper.cpp:197

Referenced by StepperMotorBase::doIteration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ step()

virtual bool StepperHw::step ( bool  positive)
pure virtual

Implemented in StepDirectionStepper, and DualHBridgeStepper.

Referenced by StepperMotorBase::doIteration(), and StepperMotorBase::setInitialPosition().

Here is the caller graph for this function:

Field Documentation

◆ m_reactionTime

float StepperHw::m_reactionTime = 5.0f
private

Definition at line 27 of file stepper.h.

Referenced by pause(), and setReactionTime().


The documentation for this class was generated from the following files: