rusEFI
The most advanced open source ECU
|
#include <single_timer_executor.h>
Public Member Functions | |
SingleTimerExecutor () | |
void | scheduleByTimestamp (const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override |
Schedule an event at specific delay after now. More... | |
void | scheduleByTimestampNt (const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override |
void | scheduleForLater (const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override |
void | cancel (scheduling_s *scheduling) override |
void | onTimerCallback () |
Data Fields | |
int | timerCallbackCounter = 0 |
int | scheduleCounter = 0 |
int | maxExecuteCounter = 0 |
int | executeCounter |
int | executeAllPendingActionsInvocationCounter = 0 |
Private Member Functions | |
void | executeAllPendingActions () |
void | scheduleTimerCallback () |
Private Attributes | |
EventQueue | queue |
bool | reentrantFlag = false |
Definition at line 13 of file single_timer_executor.h.
SingleTimerExecutor::SingleTimerExecutor | ( | ) |
Definition at line 42 of file single_timer_executor.cpp.
|
overridevirtual |
Implements ExecutorInterface.
Definition at line 94 of file single_timer_executor.cpp.
Referenced by TriggerScheduler::scheduleEventsUntilNextTriggerTooth().
|
private |
Let's execute actions we should execute at this point. reentrantFlag takes care of the use case where the actions we are executing are scheduling further invocations
in real life it could be that while we executing listeners time passes and it's already time to execute next listeners. TODO: add a counter & figure out a limit of iterations?
Definition at line 113 of file single_timer_executor.cpp.
Referenced by onTimerCallback(), and scheduleByTimestampNt().
void SingleTimerExecutor::onTimerCallback | ( | ) |
Definition at line 101 of file single_timer_executor.cpp.
Referenced by globalTimerCallback().
|
overridevirtual |
Schedule an event at specific delay after now.
Invokes event callback after the specified amount of time. callback would be executed either on ISR thread or current thread if we would need to execute right away
[in,out] | scheduling | Data structure to keep this event in the collection. |
[in] | delayUs | the number of microseconds before the output signal immediate output if delay is zero. |
[in] | dwell | the number of ticks of output duration. |
Implements ExecutorInterface.
Definition at line 62 of file single_timer_executor.cpp.
Referenced by scheduleForLater(), and toggleTestAndScheduleNext().
|
overridevirtual |
Implements ExecutorInterface.
Definition at line 66 of file single_timer_executor.cpp.
Referenced by fireSparkAndPrepareNextSchedule(), runBench(), scheduleByAngle(), scheduleByTimestamp(), and triggerScopeGetBuffer().
|
overridevirtual |
Implements ExecutorInterface.
Definition at line 48 of file single_timer_executor.cpp.
Referenced by initPwmTester(), testCallback(), validateHardwareTimer(), and watchDogBuddyCallback().
|
private |
This method is always invoked under a lock
Let's grab fresh time value
Definition at line 157 of file single_timer_executor.cpp.
Referenced by onTimerCallback(), and scheduleByTimestampNt().
int SingleTimerExecutor::executeAllPendingActionsInvocationCounter = 0 |
Definition at line 26 of file single_timer_executor.h.
Referenced by executeAllPendingActions(), and executorStatistics().
int SingleTimerExecutor::executeCounter |
Definition at line 25 of file single_timer_executor.h.
Referenced by executeAllPendingActions(), and executorStatistics().
int SingleTimerExecutor::maxExecuteCounter = 0 |
Definition at line 24 of file single_timer_executor.h.
Referenced by executeAllPendingActions(), and executorStatistics().
|
private |
Definition at line 28 of file single_timer_executor.h.
Referenced by cancel(), executeAllPendingActions(), scheduleByTimestampNt(), and scheduleTimerCallback().
|
private |
Definition at line 29 of file single_timer_executor.h.
Referenced by executeAllPendingActions(), and scheduleByTimestampNt().
int SingleTimerExecutor::scheduleCounter = 0 |
Definition at line 23 of file single_timer_executor.h.
Referenced by executorStatistics(), and scheduleByTimestampNt().
int SingleTimerExecutor::timerCallbackCounter = 0 |
Definition at line 22 of file single_timer_executor.h.
Referenced by executorStatistics(), and onTimerCallback().