Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmb_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,15 @@ void rt_cm_backtrace_exception_hook(void *context)
list_thread();
#endif

#if ((defined (__CC_ARM) && defined (__TARGET_FPU_VFP)) \
|| (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && defined (__ARM_PCS_VFP)) \
|| (defined (__ICCARM__) && defined (__ARMVFP__)) \
|| (defined (__GNUC__) && defined (__VFP_FP__) && !defined (__SOFTFP__)) )
#define USE_FPU
#endif

/* the PSP is changed by RT-Thread HardFault_Handler, so restore it to HardFault context */
#if (defined (__VFP_FP__) && !defined(__SOFTFP__)) || (defined (__ARMVFP__)) || (defined(__ARM_PCS_VFP) || defined(__TARGET_FPU_VFP))
#ifdef USE_FPU
cmb_set_psp(cmb_get_psp() + 4 * 10);
#else
cmb_set_psp(cmb_get_psp() + 4 * 9);
Expand Down Expand Up @@ -239,6 +246,7 @@ void rt_cm_backtrace_exception_hook(void *context)

void rt_cm_backtrace_assert_hook(const char* ex, const char* func, rt_size_t line)
{
rt_enter_critical();
rt_interrupt_enter();

#ifdef RT_USING_FINSH
Expand All @@ -254,6 +262,7 @@ void rt_cm_backtrace_assert_hook(const char* ex, const char* func, rt_size_t lin
cmb_println("Current system tick: %ld", rt_tick_get());

rt_interrupt_leave();
rt_exit_critical();
}

RT_WEAK rt_err_t exception_hook(void *context) {
Expand Down