feat(ota): 优化握手请求处理及OTA会话状态管理

- 新增 OTA 会话激活状态标志 s_otaSessionActive 及其访问接口
- 在设置传输发送器时激活 OTA 会话状态
- OTAHandler 初始化时显式重置状态机,防止旧状态残留
- 严格区分握手请求 payload,避免 SPI OTA 握手误判状态
- 允许更多 OTA 状态接收握手请求,提升协议容错性
- 非空闲状态拒绝新握手请求并发送等待响应
This commit is contained in:
cbb
2026-05-28 23:39:52 +08:00
parent 9d4572da13
commit 8590d327e6
3 changed files with 19 additions and 5 deletions
+2
View File
@@ -43,6 +43,7 @@ public:
static void onCsExtiInterrupt();
static void feedRxBytes(const u8 *data, u16 len);
static bool hasTxFrame();
static bool hasActiveSession();
static u16 copyTxFrame(u8 *out, u16 max_len);
static void isrProcessFrame();
@@ -59,6 +60,7 @@ public:
static volatile bool s_txPending;
static volatile bool s_isrResponded;
static volatile bool s_isrLogPending;
static volatile bool s_otaSessionActive;
static u8 s_isrLogBuf[kIsrLogBufSize];
static u16 s_isrLogLen;