shuichan_old/V1.4-Chinese/STM32F103_App1/HardWare/SYSINIT/reset_log.h

16 lines
728 B
C
Raw Normal View History

#ifndef RESET_LOG_H
#define RESET_LOG_H
#include <stdint.h>
#include "boot_share.h" /* RSN_x 原因码定义 */
/* 重启记录W25Q64 外部 Flash 环形存储 10 条(原因码 + 上次运行时长),断电不丢。
* "固件版本" 10 */
void reset_log_boot(void); /* 开机调用:生成本次记录 + 打印最近10条 */
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 */