let's move away from PeriodicTimerController
This commit is contained in:
parent
83255edf7d
commit
dfb7cf7a95
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
|
|
||||||
#include "periodic_task.h"
|
#include "periodic_thread_controller.h"
|
||||||
|
|
||||||
// Just in case we have a mechanism to validate that hardware timer is clocked right and all the
|
// Just in case we have a mechanism to validate that hardware timer is clocked right and all the
|
||||||
// conversions between wall clock and hardware frequencies are done right
|
// conversions between wall clock and hardware frequencies are done right
|
||||||
|
@ -107,16 +107,15 @@ void portMicrosecondTimerCallback() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MicrosecondTimerWatchdogController : public PeriodicTimerController {
|
struct MicrosecondTimerWatchdogController : public PeriodicController<256> {
|
||||||
void PeriodicTask() override {
|
MicrosecondTimerWatchdogController()
|
||||||
efitick_t nowNt = getTimeNowNt();
|
: PeriodicController("MstWatchdog", NORMALPRIO, 2)
|
||||||
|
{
|
||||||
// 2 seconds of inactivity would not look right
|
|
||||||
efiAssertVoid(ObdCode::CUSTOM_TIMER_WATCHDOG, nowNt < lastSetTimerTimeNt + 2 * CORE_CLOCK, "Watchdog: no events for 2 seconds!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int getPeriodMs() override {
|
void PeriodicTask(efitick_t nowNt) override {
|
||||||
return 500;
|
// 2 seconds of inactivity would not look right
|
||||||
|
efiAssertVoid(ObdCode::CUSTOM_TIMER_WATCHDOG, nowNt < lastSetTimerTimeNt + 2 * CORE_CLOCK, "Watchdog: no events for 2 seconds!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue