Skip to content

Commit 84fc61c

Browse files
committed
Merge pull request #1716 from neilt6/master
[RTOS] Improved Error Functions
2 parents 53b5432 + a484830 commit 84fc61c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,17 @@ void os_idle_demon (void) {
357357
extern void error(const char* format, ...);
358358
extern osThreadId svcThreadGetId (void);
359359

360-
#include "stdio.h"
361-
362360
void os_error (uint32_t err_code) {
363361
/* This function is called when a runtime error is detected. Parameter */
364362
/* 'err_code' holds the runtime error code (defined in RTX_Config.h). */
365363
osThreadId err_task = svcThreadGetId();
366-
error("CMSIS RTX error code: 0x%08X, task ID: 0x%08X\n", err_code, (uint32_t)err_task);
364+
error("RTX error code: 0x%08X, task ID: 0x%08X\n", err_code, err_task);
367365
}
368366

369367
void sysThreadError(osStatus status) {
370368
if (status != osOK) {
371-
mbed_die();
369+
osThreadId err_task = svcThreadGetId();
370+
error("CMSIS-RTOS error status: 0x%08X, task ID: 0x%08X\n", status, err_task);
372371
}
373372
}
374373

0 commit comments

Comments
 (0)