From 479d870b30b7b1a05265339bf269f44e1f5f1233 Mon Sep 17 00:00:00 2001 From: "Gabriel M. Beddingfield" Date: Wed, 15 Nov 2023 07:38:47 -0800 Subject: [PATCH] CMSIS: define osSysTickRateHz in CMSIS headers This requires that the application define configSPAN_SYS_TICK_RATE_HZ. We primarily need it because we need an integer literal for defining a std::chrono-style clock based on the "SysTick". Note that this updates both copies of the "control blocks" header. I'm not sure why we have two. --- CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h | 5 +++++ CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h b/CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h index ce02e881..2623af06 100644 --- a/CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h +++ b/CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h @@ -17,6 +17,11 @@ #define osTickRateHz (configTICK_RATE_HZ) #define osMaxDelayTicks (portMAX_DELAY) +#ifndef configSPAN_SYS_TICK_RATE_HZ +#error configSPAN_SYS_TICK_RATE_HZ must be defined to a literal integer +#endif +#define osSysTickRateHz (configSPAN_SYS_TICK_RATE_HZ) + typedef StaticTask_t osThreadControlBlock; typedef MemPool_t osMemoryPoolControlBlock; typedef StaticQueue_t osMessageQueueControlBlock; diff --git a/CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h b/CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h index e4d8d6a6..fbf6789f 100644 --- a/CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h +++ b/CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h @@ -17,6 +17,11 @@ #define osTickRateHz (configTICK_RATE_HZ) #define osMaxDelayTicks (portMAX_DELAY) +#ifndef configSPAN_SYS_TICK_RATE_HZ +#error configSPAN_SYS_TICK_RATE_HZ must be defined to a literal integer +#endif +#define osSysTickRateHz (configSPAN_SYS_TICK_RATE_HZ) + typedef MemPool_t MemoryPoolControlBlock; typedef StaticQueue_t MessageQueueControlBlock;