pull/18/merge
linghu 6 years ago committed by GitHub
commit 99517611ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -275,6 +275,10 @@ static void get_cur_thread_stack_info(uint32_t sp, uint32_t *start_addr, size_t
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS)
*start_addr = (uint32_t)vTaskStackAddr();
*size = vTaskStackSize() * sizeof( StackType_t );
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5)
//osRtxThread_t *thread = osRtxInfo.thread.run.curr;
*start_addr = (uint32_t) osRtxInfo.thread.run.curr->stack_mem;
*size = osRtxInfo.thread.run.curr->stack_size;
#endif
}
@ -299,6 +303,16 @@ static const char *get_cur_thread_name(void) {
return (const char *)OSTCBCurPtr->NamePtr;
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS)
return vTaskName();
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5)
//osRtxThread_t *thread = osRtxInfo.thread.run.curr;
if ((osRtxInfo.thread.run.curr == NULL) || (osRtxInfo.thread.run.curr->id != osRtxIdThread)) {
return NULL; //lint !e{904} "Return statement before end of function" [MISRA Note 1]
}
if (osRtxInfo.thread.run.curr->state == osRtxObjectInactive) {
return NULL; //lint -e{904} "Return statement before end of function" [MISRA Note 1]
}
return osRtxInfo.thread.run.curr->name;
#endif
}

@ -36,7 +36,7 @@
/* enable OS platform */
/* #define CMB_USING_OS_PLATFORM */
/* OS platform type, must config when CMB_USING_OS_PLATFORM is enable */
/* #define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_RTT or CMB_OS_PLATFORM_UCOSII or CMB_OS_PLATFORM_UCOSIII or CMB_OS_PLATFORM_FREERTOS */
/* #define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_RTT or CMB_OS_PLATFORM_UCOSII or CMB_OS_PLATFORM_UCOSIII or CMB_OS_PLATFORM_FREERTOS or CMB_OS_PLATFORM_RTX5 */
/* cpu platform type, must config by user */
#define CMB_CPU_PLATFORM_TYPE /* CMB_CPU_ARM_CORTEX_M0 or CMB_CPU_ARM_CORTEX_M3 or CMB_CPU_ARM_CORTEX_M4 or CMB_CPU_ARM_CORTEX_M7 */
/* enable dump stack information */

@ -45,6 +45,7 @@
#define CMB_OS_PLATFORM_UCOSII 1
#define CMB_OS_PLATFORM_UCOSIII 2
#define CMB_OS_PLATFORM_FREERTOS 3
#define CMB_OS_PLATFORM_RTX5 4
#define CMB_PRINT_LANGUAGE_ENGLISH 0
#define CMB_PRINT_LANGUAGE_CHINESE 1
@ -306,6 +307,8 @@ if (!(EXPR)) \
extern uint32_t *vTaskStackAddr(void);/* need to modify the FreeRTOS/tasks source code */
extern uint32_t vTaskStackSize(void);
extern char * vTaskName(void);
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5)
#include <rtx_os.h>
#else
#error "not supported OS type"
#endif /* (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTT) */

Loading…
Cancel
Save