rusEFI
The most advanced open source ECU
|
Here we have a 1MHz timer dedicated to event scheduling. We are using one of the 32-bit timers here, so this timer can schedule events up to 4B/100M ~ 4000 seconds ~ 1 hour from current time.
GPT5 timer clock: 84000000Hz If only it was a better multiplier of 2 (84000000 = 328125 * 256)
Definition in file microsecond_timer.cpp.
Functions | |
void | setHardwareSchedulerTimer (efitick_t nowNt, efitick_t setTimeNt) |
void | globalTimerCallback () |
void | portMicrosecondTimerCallback () |
static void | watchDogBuddyCallback (void *) |
static void | timerValidationCallback (void *) |
static void | validateHardwareTimer () |
void | initMicrosecondTimer () |
Variables | |
uint32_t | maxPrecisionCallbackDuration = 0 |
static efitick_t | lastSetTimerTimeNt |
static bool | isTimerPending = false |
static int | timerCallbackCounter = 0 |
static int | timerRestartCounter = 0 |
static int | timerFreezeCounter = 0 |
static int | setHwTimerCounter = 0 |
static bool | hwStarted = false |
static MicrosecondTimerWatchdogController | watchdogControllerInstance |
static scheduling_s | watchDogBuddy |
static volatile bool | testSchedulingHappened = false |
static Timer | testScheduling |
void globalTimerCallback | ( | ) |
Definition at line 36 of file single_timer_executor.cpp.
Referenced by portMicrosecondTimerCallback().
void initMicrosecondTimer | ( | ) |
Definition at line 172 of file microsecond_timer.cpp.
Referenced by initSingleTimerExecutorHardware().
void portMicrosecondTimerCallback | ( | ) |
Definition at line 98 of file microsecond_timer.cpp.
Referenced by hwTimerCallback(), and hwTimerCallback().
void setHardwareSchedulerTimer | ( | efitick_t | nowNt, |
efitick_t | setTimeNt | ||
) |
sets the alarm to the specified number of microseconds from now. This function should be invoked under kernel lock which would disable interrupts.
#259 BUG error: not positive deltaTimeNt Once in a while we night get an interrupt where we do not expect it
Definition at line 50 of file microsecond_timer.cpp.
Referenced by SingleTimerExecutor::scheduleTimerCallback().
|
static |
Definition at line 140 of file microsecond_timer.cpp.
Referenced by validateHardwareTimer().
|
static |
This method would validate that hardware timer callbacks happen with some reasonable precision helps to make sure our GPT hardware settings are somewhat right
Definition at line 153 of file microsecond_timer.cpp.
Referenced by initMicrosecondTimer().
|
static |
the purpose of this periodic activity is to make watchdogControllerInstance watchdog happy by ensuring that we have scheduler activity even in case of very broken configuration without any PWM or input pins
Definition at line 128 of file microsecond_timer.cpp.
Referenced by initMicrosecondTimer(), and watchDogBuddyCallback().
|
static |
Definition at line 44 of file microsecond_timer.cpp.
Referenced by initMicrosecondTimer(), and setHardwareSchedulerTimer().
|
static |
Definition at line 37 of file microsecond_timer.cpp.
Referenced by portMicrosecondTimerCallback(), and setHardwareSchedulerTimer().
|
static |
Definition at line 36 of file microsecond_timer.cpp.
Referenced by initMicrosecondTimer(), and setHardwareSchedulerTimer().
uint32_t maxPrecisionCallbackDuration = 0 |
Maximum duration of complete timer callback, all pending events together See also 'maxEventCallbackDuration' for maximum duration of one event
Definition at line 34 of file microsecond_timer.cpp.
Referenced by portMicrosecondTimerCallback(), and resetMaxValues().
|
static |
Definition at line 43 of file microsecond_timer.cpp.
Referenced by setHardwareSchedulerTimer().
|
static |
Definition at line 138 of file microsecond_timer.cpp.
Referenced by timerValidationCallback(), and validateHardwareTimer().
|
static |
Definition at line 137 of file microsecond_timer.cpp.
Referenced by timerValidationCallback(), and validateHardwareTimer().
|
static |
Definition at line 39 of file microsecond_timer.cpp.
Referenced by portMicrosecondTimerCallback().
|
static |
Definition at line 42 of file microsecond_timer.cpp.
Referenced by setHardwareSchedulerTimer().
|
static |
Definition at line 40 of file microsecond_timer.cpp.
Referenced by setHardwareSchedulerTimer().
|
static |
Definition at line 126 of file microsecond_timer.cpp.
Referenced by validateHardwareTimer(), and watchDogBuddyCallback().
|
static |
Definition at line 124 of file microsecond_timer.cpp.
Referenced by initMicrosecondTimer().