丢弃首次连接APP发送过来的数据转发

This commit is contained in:
OPTOC
2025-10-27 18:34:02 +08:00
parent 4d633454e9
commit b479ee103a
3 changed files with 10 additions and 0 deletions

View File

@@ -118,6 +118,7 @@ void embedded_thread(void* arg)
}
void pc_thread(void* arg)
{
static bool app_pc_discard = true;
while(true)
{
uint32_t pc_size = pc_device_get_rx_length(&sertrf.device);
@@ -127,6 +128,12 @@ void pc_thread(void* arg)
uint8_t data[pc_size];
pc_device_read(&sertrf.device, data, pc_size);
// SYS_LOG_INF("data : %s", data);
// 由于APP连接上后会发送一串我用不到的数据需要丢弃掉不然会影响我异常飞控固件升级
if(sertrf.device.ble_one_connect_flag == 1)
{
sertrf.device.ble_one_connect_flag = 0;
continue;
}
if(!sertrf.stmisp_device.flag)
embedded_device_write(&sertrf.device, data, pc_size);
}