feat: add power board ymodem proxy

实现功率板北向YMODEM透明转发状态机,取消协议板自动重发,增加双EOT、包号、CRC和超时校验。仅提交源码及Keil源文件配置,不包含编译产物。
This commit is contained in:
wrh
2026-09-28 20:18:39 +08:00
parent 3e07e2cdd6
commit c34c537bfd
8 changed files with 611 additions and 18 deletions
+3 -1
View File
@@ -156,7 +156,7 @@ static rt_uint8_t g_eload_ymodem_ready = 0; // 应答就绪标志(1=有新应
函数描述: 存储南向板返回的ymodem应答字节(由chrg_roll_sou在RUN_UPDATA调用)
输入参数: resp: 南向ymodem应答 (ACK=0x06 / NAK=0x15 / 'C'=0x43)
*****************************************************************/
#define ELOAD_YMODEM_RESP_DEPTH 8
#define ELOAD_YMODEM_RESP_DEPTH 16
static rt_uint8_t g_ymodem_resp_queue[ELOAD_YMODEM_RESP_DEPTH];
static rt_uint8_t g_ymodem_resp_read = 0;
static rt_uint8_t g_ymodem_resp_write = 0;
@@ -172,6 +172,8 @@ void chrg_eload_set_ymodem_resp(rt_uint8_t resp)
rt_hw_interrupt_enable(level);
return;
}
/* 保留新到达的ACK/NAK/CAN;队列满仅会汰汰最旧字节,
* 正常停止等待流程下队列不应到达此深度。 */
g_ymodem_resp_read = (g_ymodem_resp_read + 1) % ELOAD_YMODEM_RESP_DEPTH;
g_ymodem_resp_count--;
}