From 98a98e920d8cf964c91cb00309720d4e1bd035c3 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 27 Aug 2021 00:59:00 -0700 Subject: [PATCH] init the timer before we try to use it (#3205) * init the timer before we try to use it * format * guard --- firmware/controllers/system/periodic_task.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/system/periodic_task.h b/firmware/controllers/system/periodic_task.h index 7ac5880d50..56b7967fb1 100644 --- a/firmware/controllers/system/periodic_task.h +++ b/firmware/controllers/system/periodic_task.h @@ -35,8 +35,12 @@ public: /** * This invokes PeriodicTask() immediately and starts the cycle of invocations and sleeps */ - virtual void Start() { - runAndScheduleNext(this); - } + virtual void Start() { +#if !EFI_UNIT_TEST + chVTObjectInit(&timer); +#endif // EFI_UNIT_TEST + + runAndScheduleNext(this); + } };