diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index c92af113f7..936c4f9cb5 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -792,7 +792,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) // help to notice when RAM usage goes up - if a code change adds to RAM usage these variables would fail // linking process which is the way to raise the alarm #ifndef RAM_UNUSED_SIZE -#define RAM_UNUSED_SIZE 17500 +#define RAM_UNUSED_SIZE 19000 #endif #ifndef CCM_UNUSED_SIZE #define CCM_UNUSED_SIZE 4600 diff --git a/firmware/hw_layer/microsecond_timer.cpp b/firmware/hw_layer/microsecond_timer.cpp index 69bc32e255..89f55158ca 100644 --- a/firmware/hw_layer/microsecond_timer.cpp +++ b/firmware/hw_layer/microsecond_timer.cpp @@ -21,7 +21,7 @@ #if EFI_PROD_CODE && HAL_USE_GPT -#include "periodic_thread_controller.h" +#include "periodic_task.h" /** * Maximum duration of complete timer callback, all pending events together @@ -110,17 +110,9 @@ static void hwTimerCallback(GPTDriver *gptp) { } } -class MicrosecondTimerWatchdogController : public PeriodicController -{ -public: - MicrosecondTimerWatchdogController() - : PeriodicController("timer watchdog", NORMALPRIO, 1.0f) - { - } - -private: - void PeriodicTask(efitime_t nowNt) override - { +class MicrosecondTimerWatchdogController : public PeriodicTimerController { + void PeriodicTask() override { + efitime_t nowNt = getTimeNowNt(); if (nowNt >= lastSetTimerTimeNt + 2 * CORE_CLOCK) { strcpy(buff, "no_event"); itoa10(&buff[8], lastSetTimerValue); @@ -132,6 +124,10 @@ private: // 2 seconds of inactivity would not look right efiAssertVoid(CUSTOM_ERR_6682, nowNt < lastSetTimerTimeNt + 2 * CORE_CLOCK, msg); } + + int getPeriodMs() override { + return 500; + } }; static MicrosecondTimerWatchdogController watchdogControllerInstance; @@ -149,7 +145,7 @@ void initMicrosecondTimer(void) { lastSetTimerTimeNt = getTimeNowNt(); #if EFI_EMULATE_POSITION_SENSORS watchdogControllerInstance.Start(); -#endif /* EFI_ENGINE_EMULATOR */ +#endif /* EFI_EMULATE_POSITION_SENSORS */ } #endif /* EFI_PROD_CODE */