Skip to content

Commit 209b9a9

Browse files
committed
Add error if OS tickrate is changed
The current mbed-os drivers rely on a tickrate of 1ms for timing. This means that if OS_TICK_FREQ is set to any value other than 1000 then mbed-os driver will no longer delay for the correct amount of time. To prevent this from happening this patch triggers a compile time error if a tickrate other than 1m is used.
1 parent 0fd13b5 commit 209b9a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rtos/TARGET_CORTEX/mbed_rtx_conf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141

4242
#define OS_DYNAMIC_MEM_SIZE 0
4343

44+
#if defined(OS_TICK_FREQ) && (OS_TICK_FREQ != 1000)
45+
#error "OS Tickrate must be 1000 for system timing"
46+
#endif
47+
4448
#if defined (__CC_ARM) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
4549
/* ARM toolchain uses up to 8 static mutexes, any further mutexes will be allocated on the heap. */
4650
#define OS_MUTEX_OBJ_MEM 1

0 commit comments

Comments
 (0)