diff --git a/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h b/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h index 4fc0d536e4..1f3b799cfb 100644 --- a/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h +++ b/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h @@ -83,10 +83,10 @@ /* If os timers macro is set to 0, there's no timer thread created, therefore * main thread has tid 0x01 */ -#if (OS_TIMERS != 0) -#define MAIN_THREAD_ID 0x02 -#else +#if defined(OS_TIMERS) && (OS_TIMERS == 0) #define MAIN_THREAD_ID 0x01 +#else +#define MAIN_THREAD_ID 0x02 #endif #endif