丢弃首次连接APP发送过来的数据转发
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user