speeduino/idle.h

27 lines
889 B
C
Raw Normal View History

#define STEPPER_FORWARD 0
#define STEPPER_BACKWARD 1
2015-08-20 06:21:27 -07:00
#define IDLE_TABLE_SIZE 10
2015-05-29 00:33:00 -07:00
enum StepperStatus {SOFF, STEPPING, COOLING}; //The 2 statuses that a stepper can have. STEPPING means that a high pulse is currently being sent and will need to be turned off at some point.
2015-05-29 00:33:00 -07:00
struct StepperIdle
{
unsigned int curIdleStep; //Tracks the current location of the stepper
unsigned int targetIdleStep; //What the targetted step is
2015-05-29 00:33:00 -07:00
volatile StepperStatus stepperStatus;
volatile unsigned long stepStartTime; //The time the curren
};
2015-08-20 06:21:27 -07:00
struct table2D iacClosedLoopTable;
struct table2D iacPWMTable;
struct table2D iacStepTable;
//Open loop tables specifically for cranking
struct table2D iacCrankStepsTable;
struct table2D iacCrankDutyTable;
2015-08-20 21:14:47 -07:00
struct StepperIdle idleStepper;
2015-08-20 06:21:27 -07:00
bool idleOn; //Simply tracks whether idle was on last time around
unsigned int iacStepTime;
2015-05-29 00:33:00 -07:00
void initialiseIdle();