Skip to content

Commit da2f8e5

Browse files
committed
mbed_error.c: reducing RTX restriction.
1 parent 95d2eb8 commit da2f8e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

platform/source/mbed_error.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,22 @@ static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsign
168168
current_error_ctx.thread_current_sp = (uint32_t)&current_error_ctx; // Address local variable to get a stack pointer
169169
}
170170

171-
#ifdef MBED_CONF_RTOS_PRESENT
172171
if (mfc && !(mfc->EXC_RETURN & 0x4)) {
173172
// handler mode
174173
current_error_ctx.thread_id = 0;
175174
current_error_ctx.thread_entry_address = 0;
176175
current_error_ctx.thread_stack_size = MAX(0, (int)INITIAL_SP - (int)current_error_ctx.thread_current_sp - (int)sizeof(int));
177176
current_error_ctx.thread_stack_mem = current_error_ctx.thread_current_sp;
178177
} else {
178+
#ifdef MBED_CONF_RTOS_PRESENT
179179
// Capture thread info in thread mode
180180
osRtxThread_t *current_thread = osRtxInfo.thread.run.curr;
181181
current_error_ctx.thread_id = (uint32_t)current_thread;
182182
current_error_ctx.thread_entry_address = (uint32_t)current_thread->thread_addr;
183183
current_error_ctx.thread_stack_size = current_thread->stack_size;
184184
current_error_ctx.thread_stack_mem = (uint32_t)current_thread->stack_mem;
185-
}
186185
#endif //MBED_CONF_RTOS_PRESENT
186+
}
187187

188188
#if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED
189189
//Capture filename/linenumber if provided
@@ -482,7 +482,7 @@ static inline const char *name_or_unnamed(const osRtxThread_t *thread)
482482
* @param stack_sp The stack pointer currently at. */
483483
static void print_stack_dump(uint32_t stack_start, uint32_t stack_size, uint32_t stack_sp)
484484
{
485-
#if MBED_STACK_DUMP_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
485+
#if MBED_STACK_DUMP_ENABLED
486486
#define STACK_DUMP_WIDTH 8
487487
#define INT_ALIGN_MASK (~(sizeof(int) - 1))
488488
mbed_error_printf("\n\nStack Dump:");

0 commit comments

Comments
 (0)