feat(spi): 更新SPI命令v2,处理逻辑和项目配置

- 在cproject.yml中添加spi_link模块组和相关头文件路径
- 修改boot_request.cpp中的ACK响应机制,改用标准帧格式并优化CAN反馈处理
- 重构ping.cpp响应payload结构,包含版本信息、运行时间等16字节数据
- 添加systick.h依赖用于获取系统运行时间
- 优化启动bootloader流程,避免SPI中断阻塞问题
This commit is contained in:
cbb
2026-07-13 03:10:37 +08:00
parent 10989939e9
commit 7c05496b89
9 changed files with 422 additions and 345 deletions
+8 -3
View File
@@ -42,13 +42,18 @@ public:
/** @brief 若已确认进入 BOOT 请求,则延迟片刻后复位。 */
static void process();
/** @brief 查询是否已收到进入 Bootloader 请求(等待复位中)。
* 供主循环在复位前停止主动按铃等可能干扰 OTA 的操作。 */
static bool isRebootPending() { return s_rebootPending; }
/** @brief 查询是否已进入“即将进 BOOT”路径(异步 pending 或已写标志待复位)。
* 供 CAN 按铃等模块在复位前停止干扰 SPI 的操作。 */
static bool isRebootPending() { return s_rebootPending || s_bootRequestPending; }
/** @brief SPI 命令路径查询:true 时忽略业务帧,仅释放 ready。 */
static bool isSpiFrozenForBoot() { return s_spiFrozenForBoot; }
private:
static volatile bool s_rebootPending;
static volatile bool s_bootRequestPending; ///< 0xB0 异步请求标志,process() 中执行 Flash 操作
/** 写 OTA 配置页期间冻结 SPI 业务,避免 Flash 擦写与 SPI ISR 互踩。 */
static volatile bool s_spiFrozenForBoot;
};
#endif /* SYS_OTA_BOOT_REQUEST_H */