From ed76e22e1b5fb35511a73916902443c59e6a85c1 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Mon, 29 Mar 2021 19:59:38 -0700 Subject: [PATCH] speed up boot by 48 ms (#2506) * speed up boot * two --- firmware/hw_layer/microsecond_timer/microsecond_timer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/hw_layer/microsecond_timer/microsecond_timer.cpp b/firmware/hw_layer/microsecond_timer/microsecond_timer.cpp index 20afd06616..baa12840a2 100644 --- a/firmware/hw_layer/microsecond_timer/microsecond_timer.cpp +++ b/firmware/hw_layer/microsecond_timer/microsecond_timer.cpp @@ -24,7 +24,7 @@ EXTERN_ENGINE; // 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 // delay in milliseconds -#define TEST_CALLBACK_DELAY 30 +#define TEST_CALLBACK_DELAY 10 // if hardware timer is 20% off we throw a critical error and call it a day // maybe this threshold should be 5%? 10%? #define TIMER_PRECISION_THRESHOLD 0.2 @@ -166,7 +166,7 @@ static void validateHardwareTimer() { // to save RAM let's use 'watchDogBuddy' here once before we enable watchdog engine->executor.scheduleForLater(&watchDogBuddy, MS2US(TEST_CALLBACK_DELAY), timerValidationCallback); - chThdSleepMilliseconds(2 * TEST_CALLBACK_DELAY); + chThdSleepMilliseconds(TEST_CALLBACK_DELAY + 2); if (!testSchedulingHappened) { firmwareError(CUSTOM_ERR_TIMER_TEST_CALLBACK_NOT_HAPPENED, "hwTimer not alive"); }