6 assertNotInListMethodBody(head, element, nextToothEvent)
10 event->setAngle(angle);
22 efitick_t edgeTimestamp,
25 float currentPhase,
float nextPhase) {
26 event->setAngle(angle);
51 criticalError(
"Negative angle %s %f", msg, event->
getAngle());
54 event->action = action;
57 chibios_rt::CriticalSectionLocker csl;
71 efitick_t edgeTimestamp,
float currentPhase,
float nextPhase) {
73 if (!isValidRpm(rpm)) {
82 chibios_rt::CriticalSectionLocker csl;
88 LL_FOREACH_SAFE2(keephead, current, tmp, nextToothEvent)
100 LL_DELETE2(keephead, current, nextToothEvent);
104 #if SPARK_EXTREME_LOGGING
105 efiPrintf(
"time to invoke [%.1f, %.1f) %d %d",
125 chibios_rt::CriticalSectionLocker csl;
138 float angleOffset = this->
enginePhase - currentPhase;
139 if (angleOffset < 0) {
157 criticalError(
"getElementAtIndexForUnitText: null");
SingleTimerExecutor executor
void cancel(scheduling_s *scheduling) override
AngleBasedEvent * m_angleBasedEventsHead
bool assertNotInList(AngleBasedEvent *head, AngleBasedEvent *element)
AngleBasedEvent * getElementAtIndexForUnitTest(int index)
bool scheduleOrQueue(const char *msg, AngleBasedEvent *event, efitick_t edgeTimestamp, angle_t angle, action_s action, float currentPhase, float nextPhase)
void schedule(const char *msg, AngleBasedEvent *event, angle_t angle, action_s action)
void scheduleEventsUntilNextTriggerTooth(int rpm, efitick_t edgeTimestamp, float currentPhase, float nextPhase)
bool isPhaseInRange(float test, float current, float next)
efitimeus_t getTimeNowUs()
int time2print(int64_t time)
efitick_t scheduleByAngle(scheduling_s *timer, efitick_t nowNt, angle_t angle, action_s action)
bool shouldSchedule(float currentPhase, float nextPhase) const
float getAngleFromNow(float currentPhase) const
AngleBasedEvent * nextToothEvent