#define SET_COMPARE(compare, value)
Definition board_definition.h:86
int16_t CRANK_ANGLE_MAX_IGN
The number of crank degrees that the system tracks ignition over.
Definition crankMaths.cpp:14
int16_t CRANK_ANGLE_MAX_INJ
The number of crank degrees that the system tracks fuel injection over.
Definition crankMaths.cpp:15
Crank revolution based mathematical functions.
uint16_t timeToAngle(uint32_t time) noexcept
Converts a time interval in microsecods to the equivalent degrees of angular (crank) rotation at curr...
COMPARE_TYPE angleToTimerTicks(uint16_t angle) noexcept
Converts angular degrees to the equivalent timer ticks at current RPM.
static int16_t ignitionLimits(int16_t angle)
Makes one pass at nudging the angle to within [0,CRANK_ANGLE_MAX_IGN].
Definition crankMaths.h:54
uint32_t angleToTime(uint16_t angle) noexcept
Converts angular degrees to the time interval that amount of rotation will take at current RPM.
static constexpr uint16_t MIN_REVOLUTION_TIME
Minimum time in µS that one crank revolution can take.
Definition crankMaths.h:36
page_iterator_t advance(const page_iterator_t &iter)
Definition pages.cpp:529
#define FORCE_INLINE
Definition preprocessor.h:82
static uint32_t _calculateIgnitionTimeout(const IgnitionSchedule &schedule, int16_t crankAngle)
Definition schedule_calcs.hpp:140
static uint32_t calculateInjectorTimeout(const FuelSchedule &schedule, int16_t crankAngle, uint16_t openAngle)
Calculate the time in uS from now to when the injector should be opened.
Definition schedule_calcs.hpp:95
static uint16_t updatePwAngleCache(uint16_t pw, injectorAngleCalcCache *pCache)
Definition schedule_calcs.hpp:43
static int16_t _calculateSparkAngle(const IgnitionSchedule &schedule, int8_t advance)
Definition schedule_calcs.hpp:114
static FORCE_INLINE uint16_t _adjustToTDC(int16_t angle, uint16_t angleOffset, uint16_t maxAngle)
Definition schedule_calcs.hpp:65
static void adjustCrankAngle(const statuses ¤t, IgnitionSchedule &schedule, int16_t crankAngle)
Adjust the crank angle used to originally set the schedule.
Definition schedule_calcs.hpp:155
static int16_t _calculateCoilChargeAngle(uint16_t dwellAngle, int16_t dischargeAngle)
Definition schedule_calcs.hpp:120
static void calculateIgnitionAngles(IgnitionSchedule &schedule, uint16_t dwellAngle, int8_t advance)
Definition schedule_calcs.hpp:127
static uint16_t _calculateOpenAngle(FuelSchedule &schedule, uint16_t pwDegrees, uint16_t injAngle)
Compute the injector open angle for an injection channel.
Definition schedule_calcs.hpp:21
static void calculateIgnitionTrailingRotary(IgnitionSchedule &leading, uint16_t dwellAngle, int16_t rotarySplitDegrees, IgnitionSchedule &trailing)
Definition schedule_calcs.hpp:134
static FORCE_INLINE uint32_t _calculateAngularTime(const Schedule &schedule, uint16_t eventAngle, uint16_t crankAngle, uint16_t maxAngle)
Definition schedule_calcs.hpp:56
@ PENDING
Definition scheduler.h:56
@ OFF
Definition scheduler.h:54
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:133
const config2 const config4 const config6 statuses & current
Definition scheduler_fuel_controller.cpp:402
uint16_t crankAngle
Definition scheduler_ignition_controller.cpp:462
uint16_t dwellAngle
Definition scheduler_ignition_controller.cpp:433
The statuses struct and related defines.
A fuel injection schedule.
Definition scheduler.h:207
An ignition schedule.
Definition scheduler.h:177
A schedule for a single output channel.
Definition scheduler.h:86
Definition schedule_calcs.hpp:38
uint16_t pwDegrees
Definition schedule_calcs.hpp:40
uint16_t pw
Definition schedule_calcs.hpp:39
The status struct with current values for all 'live' variables.
Definition statuses.h:47