127 virtual void reset(
void);
187 void reset(
void)
override;
215 void reset(
void)
override;
#define FUEL1_COUNTER
Definition board_avr2560.h:69
uint16_t COMPARE_TYPE
The timer overflow type.
Definition board_avr2560.h:32
#define FUEL1_COMPARE
Definition board_avr2560.h:87
Crank revolution based mathematical functions.
return flags
Definition engineProtection.cpp:170
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175
void moveToNextState(IgnitionSchedule &schedule) noexcept
Shared ignition schedule timer ISR implementation. Should be called by the actual ignition timer ISRs...
Definition scheduler.cpp:180
void nullCallback(void)
A scheduler callback that does nothing.
Definition scheduler.cpp:37
void setCallbacks(Schedule &schedule, Schedule::callback pStartCallback, Schedule::callback pEndCallback) noexcept
Set the schedule callbacks. I.e the functions called when the action needs to start & stop.
Definition scheduler.cpp:59
ScheduleStatus
The current state of a schedule.
Definition scheduler.h:51
@ RUNNING
Definition scheduler.h:59
@ PENDING
Definition scheduler.h:57
@ RUNNING_WITHNEXT
Definition scheduler.h:61
@ OFF
Definition scheduler.h:55
void setSchedule(Schedule &schedule, uint32_t delay, uint16_t duration, bool allowQueuedSchedule)
Set the schedule action to run for a certain duration in the future.
Definition scheduler.cpp:92
static bool isRunning(const Schedule &schedule) noexcept
Is the schedule running? I.e. the action has started, but not finished. E.g. injector is open.
Definition scheduler.h:134
A fuel injection schedule.
Definition scheduler.h:208
void reset(void) override
Definition scheduler.cpp:53
uint16_t pw
Pulse width in uS.
Definition scheduler.h:213
uint16_t channelDegrees
The number of crank degrees until cylinder is at TDC
Definition scheduler.h:212
An ignition schedule.
Definition scheduler.h:178
void reset(void) override
Definition scheduler.cpp:45
uint16_t channelDegrees
The number of crank degrees until cylinder is at TDC
Definition scheduler.h:185
int16_t dischargeAngle
Angle the coil should discharge at. I.e. spark.
Definition scheduler.h:184
volatile uint32_t _startTime
The system time (in uS) that the schedule started, used by the overdwell protection in timers....
Definition scheduler.h:182
int16_t chargeAngle
Angle the coil should begin charging.
Definition scheduler.h:183
A schedule for a single output channel.
Definition scheduler.h:87
COMPARE_TYPE _nextStartCompare
Planned start of next schedule (when current schedule is RUNNING)
Definition scheduler.h:121
counter_t & _counter
Reference to the counter register. E.g. TCNT3
Definition scheduler.h:123
callback _pEndCallback
End Callback function for schedule.
Definition scheduler.h:120
void(*)(void) callback
Definition scheduler.h:108
constexpr Schedule(counter_t &counter, compare_t &compare)
Construct a new Schedule object.
Definition scheduler.h:102
decltype(FUEL1_COUNTER) counter_t
The type of a timer counter register (this varies between platforms)
Definition scheduler.h:92
volatile ScheduleStatus _status
Schedule status: OFF, PENDING, STAGED, RUNNING.
Definition scheduler.h:118
compare_t & _compare
**Reference**to the compare register. E.g. OCR3A
Definition scheduler.h:124
volatile COMPARE_TYPE _duration
Scheduled duration (timer ticks)
Definition scheduler.h:117
callback _pStartCallback
Start Callback function for schedule.
Definition scheduler.h:119
virtual void reset(void)
Definition scheduler.cpp:39
decltype(FUEL1_COMPARE) compare_t
The type of a timer compare register (this varies between platforms)
Definition scheduler.h:94