47#define USE_IGN_REFRESH
48#define IGNITION_REFRESH_THRESHOLD 30
50#define DWELL_AVERAGE_ALPHA 30
51#define DWELL_AVERAGE(input) LOW_PASS_FILTER((input), DWELL_AVERAGE_ALPHA, currentStatus.actualDwell)
63#if defined(ARDUINO_ARCH_STM32) || defined(CORE_TEENSY)
68#if (INJ_CHANNELS >= 5)
71#if (INJ_CHANNELS >= 6)
74#if (INJ_CHANNELS >= 7)
77#if (INJ_CHANNELS >= 8)
80#if (IGN_CHANNELS >= 1)
83#if (IGN_CHANNELS >= 2)
86#if (IGN_CHANNELS >= 3)
89#if (IGN_CHANNELS >= 4)
92#if (IGN_CHANNELS >= 5)
95#if (IGN_CHANNELS >= 6)
98#if (IGN_CHANNELS >= 7)
101#if (IGN_CHANNELS >= 8)
uint32_t angleToTimeMicroSecPerDegree(uint16_t angle)
Definition crankMaths.cpp:35
int CRANK_ANGLE_MAX_IGN
Definition globals.cpp:129
int 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:130
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:349
void fuelSchedule1Interrupt()
Definition scheduler.cpp:366
void fuelSchedule3Interrupt()
Definition scheduler.cpp:386
void fuelSchedule2Interrupt()
Definition scheduler.cpp:376
void fuelSchedule4Interrupt()
Definition scheduler.cpp:396
void ignitionSchedule1Interrupt(void)
Definition scheduler.cpp:489
void _setIgnitionScheduleNext(IgnitionSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.cpp:259
void setFuelSchedule(FuelSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.h:208
void _setFuelScheduleNext(FuelSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.cpp:229
void initialiseSchedulers(void)
Definition scheduler.cpp:79
void _setFuelScheduleRunning(FuelSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.cpp:213
IgnitionSchedule ignitionSchedule5
FuelSchedule fuelSchedule3
void refreshIgnitionSchedule1(unsigned long timeToEnd)
Definition scheduler.cpp:272
FuelSchedule fuelSchedule4
void disablePendingIgnSchedule(byte channel)
Definition scheduler.cpp:612
void _setIgnitionScheduleRunning(IgnitionSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.cpp:242
IgnitionSchedule ignitionSchedule1
FuelSchedule fuelSchedule1
IgnitionSchedule ignitionSchedule4
void disablePendingFuelSchedule(byte channel)
Definition scheduler.cpp:572
void setIgnitionSchedule(IgnitionSchedule &schedule, unsigned long timeout, unsigned long duration)
Definition scheduler.h:154
FuelSchedule fuelSchedule2
void beginInjectorPriming(void)
Definition scheduler.cpp:289
ScheduleStatus
Definition scheduler.h:111
@ RUNNING
Definition scheduler.h:111
@ PENDING
Definition scheduler.h:111
@ STAGED
Definition scheduler.h:111
@ OFF
Definition scheduler.h:111
IgnitionSchedule ignitionSchedule3
IgnitionSchedule ignitionSchedule2
Definition scheduler.h:174
void(&) pTimerDisable()
Definition scheduler.h:201
void(* pEndFunction)(void)
Definition scheduler.h:195
void(&) pTimerEnable()
Definition scheduler.h:202
COMPARE_TYPE nextStartCompare
Definition scheduler.h:196
decltype(FUEL1_COUNTER) counter_t
Definition scheduler.h:179
volatile COMPARE_TYPE startCompare
The counter value of the timer when this will start.
Definition scheduler.h:193
FuelSchedule(counter_t &counter, compare_t &compare, void(&_pTimerDisable)(), void(&_pTimerEnable)())
Definition scheduler.h:182
volatile ScheduleStatus Status
Schedule status: OFF, PENDING, STAGED, RUNNING.
Definition scheduler.h:192
counter_t & counter
Definition scheduler.h:199
decltype(FUEL1_COMPARE) compare_t
Definition scheduler.h:180
compare_t & compare
Definition scheduler.h:200
volatile unsigned long duration
Scheduled duration (uS)
Definition scheduler.h:191
volatile bool hasNextSchedule
Definition scheduler.h:197
void(* pStartFunction)(void)
Definition scheduler.h:194
Definition scheduler.h:115
decltype(IGN1_COMPARE) compare_t
Definition scheduler.h:121
volatile ScheduleStatus Status
Schedule status: OFF, PENDING, STAGED, RUNNING.
Definition scheduler.h:133
COMPARE_TYPE nextStartCompare
Planned start of next schedule (when current schedule is RUNNING)
Definition scheduler.h:140
void(* pStartCallback)(void)
Start Callback function for schedule.
Definition scheduler.h:134
void(&) pTimerEnable()
Definition scheduler.h:148
IgnitionSchedule(counter_t &counter, compare_t &compare, void(&_pTimerDisable)(), void(&_pTimerEnable)())
Definition scheduler.h:123
compare_t & compare
Definition scheduler.h:146
volatile unsigned long startTime
Definition scheduler.h:136
decltype(IGN1_COUNTER) counter_t
Definition scheduler.h:120
COMPARE_TYPE nextEndCompare
Planned end of next schedule (when current schedule is RUNNING)
Definition scheduler.h:141
volatile unsigned long duration
Scheduled duration (uS ?)
Definition scheduler.h:132
volatile bool hasNextSchedule
Enable flag for planned next schedule (when current schedule is RUNNING)
Definition scheduler.h:142
volatile COMPARE_TYPE startCompare
The counter value of the timer when this will start.
Definition scheduler.h:137
void(* pEndCallback)(void)
End Callback function for schedule.
Definition scheduler.h:135
counter_t & counter
Definition scheduler.h:145
void(&) pTimerDisable()
Definition scheduler.h:147
volatile COMPARE_TYPE endCompare
The counter value of the timer when this will end.
Definition scheduler.h:138
volatile bool endScheduleSetByDecoder
Definition scheduler.h:143