138 virtual void reset(
void);
198 void reset(
void)
override;
217 void reset(
void)
override;
#define FUEL1_COUNTER
Definition board_avr2560.h:71
uint16_t COMPARE_TYPE
The timer overflow type.
Definition board_avr2560.h:34
#define FUEL1_COMPARE
Definition board_avr2560.h:89
constexpr uint32_t MAX_TIMER_PERIOD
The longest period of time (in uS) that the timer can permit.
Definition board_definition.h:82
Crank revolution based mathematical functions.
uint32_t angleToTimeMicroSecPerDegree(uint16_t angle)
Converts angular degrees to the time interval that amount of rotation will take at current RPM.
return flags
Definition engineProtection.cpp:170
const config2 & page2
Definition engineProtection.cpp:438
const config4 & page4
Definition engineProtection.cpp:155
int16_t CRANK_ANGLE_MAX_INJ
The number of crank degrees that the system track over. Typically 720 divided by the number of squirt...
Definition globals.cpp:41
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175
void changeHalfToFullSync(const config2 &page2, statuses ¤t)
Definition scheduler.cpp:374
void changeFullToHalfSync(const config2 &page2, const config4 &page4, statuses ¤t)
Definition scheduler.cpp:429
void moveToNextState(IgnitionSchedule &schedule) noexcept
Shared ignition schedule timer ISR implementation. Should be called by the actual ignition timer ISRs...
Definition scheduler.cpp:315
static void setFuelSchedule(FuelSchedule &schedule, uint32_t delay, uint16_t duration)
Set the fuel schedule action (open & close an injector) to run for a certain duration in the future.
Definition scheduler.h:227
FuelSchedule fuelSchedule3
void startFuelSchedulers(void)
Start the timers that drive schedulers
Definition scheduler.cpp:113
void initialiseFuelSchedulers(void)
Initialize all schedulers to the OFF state.
Definition scheduler.cpp:76
FuelSchedule fuelSchedule4
void nullCallback(void)
A scheduler callback that does nothing.
Definition scheduler.cpp:55
FuelSchedule fuelSchedule1
void stopFuelSchedulers(void)
Stop the timers that drive schedulers
Definition scheduler.cpp:133
static bool isRunning(const Schedule &schedule)
Is the schedule running? I.e. the action has started, but not finished. E.g. injector is open.
Definition scheduler.h:145
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:153
FuelSchedule fuelSchedule2
void beginInjectorPriming(void)
Start fuel system priming the fuel.
Definition scheduler.cpp:214
ScheduleStatus
The current state of a schedule.
Definition scheduler.h:62
@ RUNNING
Definition scheduler.h:70
@ PENDING
Definition scheduler.h:68
@ RUNNING_WITHNEXT
Definition scheduler.h:72
@ OFF
Definition scheduler.h:66
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:186
const config4 statuses & current
Definition scheduler_ignition_controller.cpp:367
Definition scheduler.h:213
void reset(void) override
Definition scheduler.cpp:71
An ignition schedule.
Definition scheduler.h:189
void reset(void) override
Definition scheduler.cpp:63
int16_t dischargeAngle
Angle the coil should discharge at. I.e. spark.
Definition scheduler.h:195
volatile uint32_t _startTime
The system time (in uS) that the schedule started, used by the overdwell protection in timers....
Definition scheduler.h:193
int16_t channelDegrees
The number of crank degrees until cylinder is at TDC
Definition scheduler.h:196
int16_t chargeAngle
Angle the coil should begin charging.
Definition scheduler.h:194
A schedule for a single output channel.
Definition scheduler.h:98
COMPARE_TYPE nextStartCompare
Planned start of next schedule (when current schedule is RUNNING)
Definition scheduler.h:132
counter_t & _counter
Reference to the counter register. E.g. TCNT3
Definition scheduler.h:134
callback pStartCallback
Start Callback function for schedule.
Definition scheduler.h:130
volatile COMPARE_TYPE duration
Scheduled duration (timer ticks)
Definition scheduler.h:128
volatile ScheduleStatus Status
Schedule status: OFF, PENDING, STAGED, RUNNING.
Definition scheduler.h:129
void(*)(void) callback
Definition scheduler.h:119
constexpr Schedule(counter_t &counter, compare_t &compare)
Construct a new Schedule object.
Definition scheduler.h:113
decltype(FUEL1_COUNTER) counter_t
The type of a timer counter register (this varies between platforms)
Definition scheduler.h:103
callback pEndCallback
End Callback function for schedule.
Definition scheduler.h:131
compare_t & _compare
**Reference**to the compare register. E.g. OCR3A
Definition scheduler.h:135
virtual void reset(void)
Definition scheduler.cpp:57
decltype(FUEL1_COMPARE) compare_t
The type of a timer compare register (this varies between platforms)
Definition scheduler.h:105
Definition config_pages.h:171
Definition config_pages.h:356
The status struct with current values for all 'live' variables.
Definition statuses.h:36