mcu_ab568x/userboot240328/app/platform/bsp/bsp_halt.c
2025-05-30 18:03:10 +08:00

29 lines
525 B
C

#include "include.h"
#define TRACE_EN 1
#if TRACE_EN
#define TRACE(...) printf(__VA_ARGS__)
AT(.com_rodata.halt)
const char str_halt[] = "<<< Halt >>>: %X\n";
#else
#define TRACE(...)
#endif
AT(.com_text.halt)
void halt(u32 halt_no)
{
int reset_cnt = 15000000;
TRACE(str_halt, halt_no);
PICCON = 0;
#if GUI_EN
gui_halt(halt_no);
#endif
while (1) {
WDT_CLR();
if (reset_cnt-- <= 0) {
WDT_RST_DELAY();
}
}
}