void hal_system_reset(void) { while (1) { if (hal_debugger_connected()) { /* * If debugger is attached, breakpoint here. */ asm("bkpt"); } NVIC_SystemReset(); } }
void hal_system_reset(void) { while (1) { if (hal_debugger_connected()) { /* * If debugger is attached, breakpoint here. */ asm("BRK_S"); } /* TODO: Reset system! */ //NVIC_SystemReset(); } }
void __assert_func(const char *file, int line, const char *func, const char *e) { int sr; OS_ENTER_CRITICAL(sr); (void)sr; console_blocking_mode(); console_printf("Assert %s; failed in %s:%d\n", e ? e : "", file, line); if (hal_debugger_connected()) { /* * If debugger is attached, breakpoint before the trap. */ asm("bkpt"); } SCB->ICSR = SCB_ICSR_NMIPENDSET_Msk; asm("isb"); hal_system_reset(); }