From 7eaede341aaf051ee66e71b2f0d7b5f3a91e4171 Mon Sep 17 00:00:00 2001 From: Risto Date: Sun, 14 Feb 2021 14:33:49 +0100 Subject: [PATCH] RTOS_MS_PER_TICK calculation simplification CFG_CPU_FREQ cancels itself out in the original equation: ((CFG_CPU_FREQ / CFG_SYSTICK_FREQ) / (CFG_CPU_FREQ / 1000)) In addition, comment is now fixed - 1ms is used for STM32, 2ms was used for other chips: https://github.com/opentx/opentx/blob/e94f6c0ccdc1ecd800f2ef27a28120878bc9ec41/radio/src/thirdparty/CoOS/OsConfig.h#L88-L92 --- radio/src/rtos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/rtos.h b/radio/src/rtos.h index 6e42ebf30..98d0c0415 100644 --- a/radio/src/rtos.h +++ b/radio/src/rtos.h @@ -155,7 +155,7 @@ template } #endif - #define RTOS_MS_PER_TICK ((CFG_CPU_FREQ / CFG_SYSTICK_FREQ) / (CFG_CPU_FREQ / 1000)) // RTOS timer tick length in ms (currently 2) + #define RTOS_MS_PER_TICK (1000 / CFG_SYSTICK_FREQ) // RTOS timer tick length in ms (currently 1 for STM32, 2 for others) typedef OS_TID RTOS_TASK_HANDLE; typedef OS_MutexID RTOS_MUTEX_HANDLE;