shuichan_new/STM32F103_App1/HardWare/SYSINIT/reset_log.h

17 lines
703 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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); /* 开机调用:只生成本次记录,不打印历史 */
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 */