From 9aee702b11b942ff8580d187023e730dae3b8b6c Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Fri, 6 May 2016 12:27:25 -0500 Subject: [PATCH] RTX - pull cmsis_os into rt_Timer This causing a warning in the rt_cmsis.c, as they use preprocessor to redefine a type. A fix is to move the macro above, as it should not change anything else. This should be removed, and use a cast, however I am not fully familiar why they do this macro trick. --- libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c | 6 ++++-- libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c b/libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c index 057fced7e3..5e33684bce 100644 --- a/libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c +++ b/libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c @@ -48,6 +48,10 @@ #error "Missing __CORTEX_Mx definition" #endif +// This affects cmsis_os only, as it's not used anywhere else. This was left by kernel team +// to suppress the warning in rt_tid2ptcb about incompatible pointer assignment. +#define os_thread_cb OS_TCB + #include "rt_TypeDef.h" #include "RTX_Config.h" #include "rt_System.h" @@ -62,8 +66,6 @@ #include "rt_Memory.h" #include "rt_HAL_CM.h" -#define os_thread_cb OS_TCB - #include "cmsis_os.h" #if (osFeature_Signals != 16) diff --git a/libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c b/libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c index 29b398bdf9..fa4b84414a 100644 --- a/libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c +++ b/libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c @@ -36,6 +36,7 @@ #include "RTX_Config.h" #include "rt_Timer.h" #include "rt_MemBox.h" +#include "cmsis_os.h" #ifndef __CMSIS_RTOS