#ifndef RESET_LOG_H #define RESET_LOG_H #include #include "boot_share.h" /* RSN_x 原因码定义 */ /* 重启记录:W25Q64 外部 Flash 环形存储 10 条(原因码 + 上次运行时长),断电不丢。 * 开机时在"固件版本"日志后打印最近 10 条。 */ void reset_log_boot(void); /* 开机调用:只生成本次记录,不打印历史 */ void reset_log_print_history(void); /* 打印最近 10 条重启记录(蓝牙 HISTORY 命令用) */ void reset_log_tick(uint32_t uptime_s); /* sys_task 每秒调用:更新共享 RAM 运行时间 */ void reset_log_mark(uint8_t reason); /* 主动复位前调用:写入细分原因码(RSN_x) */ void reset_log_power_loss(void); /* 检测到外部断电(法拉电容续航中)立即写记录 */ #endif /* RESET_LOG_H */