rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_scheduler.h
Go to the documentation of this file.
1#pragma once
2
3// TriggerScheduler here is an intermediate tooth-based scheduler working on top of time-base scheduler
4// *kludge*: individual event for *Trigger*Scheduler is called *Angle*BasedEvent. Shall we rename to ToothSchedule and ToothBasedEvent?
6public:
7 // *kludge* we have three methods with *schedule* in the name meaning three different things
8 // this method just places event into the collection of tooth-based events
9 void schedule(const char *msg, AngleBasedEvent* event, angle_t angle, action_s action);
10
11 // 'schedule' means 'delegates to time-based scheduler' and 'queue' here matches the 'schedule' method above
12 bool scheduleOrQueue(const char *msg, AngleBasedEvent *event,
13 efitick_t edgeTimestamp,
14 angle_t angle,
15 action_s action,
16 float currentPhase, float nextPhase);
17
18 // scheduleForActualTimeBasedExecution using underlying time-base scheduler
20 efitick_t edgeTimestamp,
21 float currentPhase, float nextPhase);
22
23#if EFI_UNIT_TEST
25#endif // EFI_UNIT_TEST
26
27private:
28 void schedule(const char *msg, AngleBasedEvent* event, action_s action);
29
31
32 /**
33 * That's the linked list of pending events scheduled in relation to trigger
34 * At the moment we iterate over the whole list while looking for events for specific
35 * trigger index We can make it an array of lists per trigger index, but that would take
36 * some RAM and probably not needed yet.
37 */
39};
AngleBasedEvent * m_angleBasedEventsHead
bool assertNotInList(AngleBasedEvent *head, AngleBasedEvent *element)
AngleBasedEvent * getElementAtIndexForUnitTest(int index)
void scheduleEventsUntilNextTriggerTooth(float rpm, efitick_t edgeTimestamp, float currentPhase, float nextPhase)
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)