Files
ESP32_COMM/main/CMakeLists.txt
T
小龙虾 00ce8dbbb5 feat(ota): 实现 GD32 Flash 存储抽象层和 OTA 协调器接口解耦
- 新增 storage/gd32_flash_store.cpp 组件,提供 GD32 Flash 存储抽象层
- 修改 ota_coordinator.cpp/h 使其继承 IRelayListener 接口,实现与
  OtaRelay 的解耦设计
- 将 GD32 相关存储操作统一通过协调器访问,解决 H3 绕过协调器的问题
- 添加完整的 Doxygen 注释到所有公共接口和关键函数
- 更新 CMakeLists.txt 构建配置,添加 storage 组件依赖
- 重构元数据加载/清除操作使用 Gd32FlashStore 实例而非 OtaRelay 直接访问
- 添加中继事件回调接口实现,使 OtaRelay 可通知协调器状态变化
2026-06-21 23:48:31 +08:00

53 lines
2.6 KiB
CMake
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.
# ESP32-C3 OTA 中继项目 - 主组件构建配置
idf_component_register(
SRCS
"core/main.cpp" # 程序入口 (app_main)
"ota/esp32_ota_core.cpp" # ESP32 本机 OTA 核心(分区写入/SHA验证)
"ota/ota_coordinator.cpp" # OTA 多通道协调器(状态机/互斥)
"relay/ota_relay.cpp" # GD32 SPI OTA 中继状态机
"storage/gd32_flash_store.cpp" # GD32 Flash 存储抽象层(H1 提取)
"transport/spi_master.cpp" # SPI 总线驱动 + CANFD 接口
"transport/protocol.cpp" # 帧协议 + AES 加密 + CRC
"server/wifi_ota.cpp" # WiFi HTTP OTA 服务器
"server/http_handlers.cpp" # HTTP 路由处理(H2 从 wifi_ota 提取)
"server/ble_ota.cpp" # BLE GATT OTA 服务器
"monitor/health_monitor.cpp" # 系统健康监控(温度/RSSI/堆内存)
"monitor/debug_log.cpp" # 三路调试日志(UART/UDP/环形缓冲)
INCLUDE_DIRS
"."
"core"
"ota"
"relay"
"storage" # GD32 Flash 存储抽象层头文件
"transport"
"server"
"monitor"
"include" # 公共头文件(app_config.h, version.h, ota_mutex.h)
REQUIRES
app_update # ESP32 OTA API
cjson # JSON 解析/生成
esp_driver_spi # SPI 主设备驱动
esp_driver_tsens # 温度传感器驱动
esp_driver_uart # UART 驱动(调试日志)
esp_wifi # WiFi STA/AP 模式
esp_netif # 网络接口层
esp_event # 事件循环
esp_partition # Flash 分区操作
esp_timer # 高精度定时器
esp_http_server # HTTP OTA 服务器
esp_blockdev # Flash 块设备
nvs_flash # NVS 存储(OTA 元数据)
freertos # RTOS 内核
mbedtls # SHA-256 / AES 加密
bt # NimBLE BLE 协议栈
)
# 每次构建时自动刷新 version.h(BUILD_TIME / GIT_HASH)
add_custom_target(version_header ALL
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DOUTPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/include/version.h
-P ${CMAKE_SOURCE_DIR}/cmake/gen_version_script.cmake
COMMENT "Refreshing version.h"
VERBATIM
)