Skip to content

Commit

Permalink
CMSIS: define osSysTickRateHz in CMSIS headers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gabrbedd committed Nov 15, 2023
1 parent 5892d0b commit 479d870
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMSIS/RTOS2/FreeRTOS/Include/cmsis_os2_control_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions CMSIS/RTOS2/FreeRTOS/Include/os2_control_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 479d870

Please sign in to comment.