解决OTA升级的过程中出现的uart栈溢出以及OTA指示灯异常

This commit is contained in:
OPTOC
2025-10-20 12:16:10 +08:00
parent 1e15f28f72
commit a8a5bb61af
2 changed files with 11 additions and 4 deletions

View File

@@ -145,15 +145,17 @@ protocol_status_t get_protocol_status(void)
{
protocol.protocol_status = PROTOCOL_STATUS_OK;
if(protocol.pro_type == PROTOCOL_IDLE)
// 先OTA升级、未知协议、未收到飞控数据
if(protocol.message_status == MESSAGE_OTA)
{
protocol.protocol_status = PROTOCOL_STATUS_IN_OTA;
}
else if(protocol.pro_type == PROTOCOL_IDLE)
{
protocol.protocol_status = PROTOCOL_STATUS_TYPE_IDLE;
} else if(protocol.analysis_sussess_count == 0)
{
protocol.protocol_status = PROTOCOL_STATUS_NO_DATA;
} else if(protocol.message_status == MESSAGE_OTA)
{
protocol.protocol_status = PROTOCOL_STATUS_IN_OTA;
}
protocol.analysis_sussess_count = 0;

View File

@@ -394,7 +394,12 @@ void resend_user_parse(void *resend_device)
//设置协议状态,为了后续灯颜色变化
protocol_set_message_status(MESSAGE_OTA);
// if(!sertrf.resend_device.status.resend_flag)
//初始化ota会占用大量系统资源需要先把飞控获取数据关闭不然会导致栈溢出
sb_data_port_stop(sertrf.device.embedded_device);
otau_init(&sertrf.otau);
sertrf.mode_status.task_state = DATA_HANDLE_OTA_DATA;
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
}
break;