添加异常飞控固件升级

This commit is contained in:
OPTOC
2025-10-27 19:01:59 +08:00
parent d192e3e40f
commit 2800c2660b

View File

@@ -516,8 +516,11 @@ void resend_user_parse(void *resend_device)
使用sync与isp确定通讯波特率并建立联系 解除其写保护 并重新sync建立连接后擦除全部区域内存*/
//关闭其他线程中相同串口的使用
sertrf.stmisp_device.flag = 1;
// 重启飞控并使其进入isp烧录模式
fc_reboot();
// 修改灯珠颜色
protocol_set_message_status(MESSAGE_FC_ISP);
// 重启飞控并使其进入isp烧录模式 需要在能够识别飞控的情况下才需要重启
if(sertrf.fc_protocol_status != PROTOCOL_STATUS_TYPE_IDLE && sertrf.fc_protocol_status != PROTOCOL_STATUS_NO_DATA)
fc_reboot();
boot_set(0);
os_thread_sleep(1000);
//串口切换为偶校验模式,并清除缓存
@@ -525,7 +528,11 @@ void resend_user_parse(void *resend_device)
os_thread_sleep(100);
// 与isp确定通讯波特率并建立联系
if(!send_sync(&sertrf.stmisp_device, 5))
{
printf("stmisp: sync error\n");
// app_send_error_code(SERTRF_ERROR_FC_ISP_SYNC);
break;
}
else
printf("stmisp: sync ok\n");