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

42 lines
931 B
C

#include "include.h"
#include "app_variable.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;
/* >>>>>>>>>>>>>>>>>>已知故障处理 START<<<<<<<<<<<<<<<<<< */
/* 表盘错误 */
if ((func_cb.sta == FUNC_CLOCK) && (halt_no == HALT_GUI_DIALPLATE_HEAD))
{
SysVariable.dial_watch = 0;
SysVariable.dialplate_index = 0;
user_cfg_info_write();
}
/* >>>>>>>>>>>>>>>>>>已知故障处理 END<<<<<<<<<<<<<<<<<<<< */
gui_halt(halt_no);
while (1)
{
WDT_CLR();
if (reset_cnt-- <= 0)
{
WDT_RST_DELAY();
}
}
}