| 1234567891011121314151617181920 |
- #ifndef UPDATE_MANAGER_H
- #define UPDATE_MANAGER_H
- #include <stdint.h>
- #include "boot_layout.h"
- /* 校验 NOR 暂存区镜像(通过则返回 hdr)。调用方先完成 YMODEM 接收 */
- boot_err_t update_verify(fw_image_header_t *hdr);
- /* 备份 -> 烧录 -> 校验 -> 置 PENDING_CONFIRM。
- * 失败且存在完好备份时自动回滚, 返回原始失败码; 无备份时仅置错误状态 */
- boot_err_t update_run(const fw_image_header_t *hdr);
- /* 回滚: 验备份 -> 擦 APP 区 -> 备份回写 -> 校验 -> IDLE */
- boot_err_t rollback_run(void);
- /* 错误码字符串(日志用) */
- const char *boot_err_str(boot_err_t e);
- #endif /* UPDATE_MANAGER_H */
|