refactor(device): 重构SPI命令处理为模块化架构

- 将原有的 monolithic app_spi_command.cpp 拆分为多个专门的命令处理器文件
- 新增 spi_command_handler.h 定义命令处理器接口和上下文结构
- 新增 app_spi_command_defs.h 提取公共协议常量定义
- 新增多个具体命令处理器实现文件:
  - app_spi_cmd_boot_request.cpp (进入Bootloader命令)
  - app_spi_cmd_ota_wait.cpp (OTA等待响应命令)
  - app_spi_cmd_ping.cpp (APP心跳ping命令)
  - app_spi_cmd_can_bridge.cpp (SPI到CAN桥接命令)

- 修改 app_spi_command.cpp 仅负责SPI链路管理和命令路由逻辑
- 更新配置文件添加新源文件到项目编译列表
- 调整全局实例为对象实例(AppSpiCommandBus),移除静态方法依赖
- 更新README文档说明新的SPI命令总线拆分架构
- 微调版本号(patch: 0 -> 1, build: 2 -> 0)
This commit is contained in:
cbb
2026-06-23 01:49:33 +08:00
parent 01382a3fc1
commit dc91883f1e
14 changed files with 580 additions and 273 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
/**
/**
* @file task_runner.cpp
* @brief 任务执行器实现。
*/
@@ -307,5 +307,5 @@ void TaskRunner::runPending()
if(pending & (1UL << TASK_STATUS_LED)) taskStatusLed();
if(pending & (1UL << TASK_HEARTBEAT)) taskHeartbeat();
if(pending & (1UL << TASK_DIAGNOSTIC_PRINT)) taskDiagnosticPrint();
if(pending & (1UL << TASK_SPI_LOG)) AppSpiCommand::poll();
if(pending & (1UL << TASK_SPI_LOG)) AppSpiCommandBus.poll();
}