Browse Source

修复release版本下串口接收不到消息的BUG

master
zhaohe 1 year ago
parent
commit
005bb9cfee
  1. 8
      src/camera_light_src_timing_controller/qt_serial_datachannel.cpp

8
src/camera_light_src_timing_controller/qt_serial_datachannel.cpp

@ -25,8 +25,10 @@ void QTDataChannel::init() {
// ZLOGI(TAG, "rx %d bytes", rx_cnt);
if (m_rxcb) m_rxcb(rx, rx_cnt);
}
this_thread::sleep_for(chrono::microseconds(100));
} else {
this_thread::sleep_for(chrono::microseconds(10000));
}
// this_thread::sleep_for(chrono::microseconds(1000));
}
}));
}
@ -137,8 +139,8 @@ int QTDataChannel::com_receive(uint8_t *rxbuf, int rxbufsize) {
COMMTIMEOUTS TimeOuts;
GetCommTimeouts(m_CommHandler, &TimeOuts);
TimeOuts.ReadIntervalTimeout = 0; // 读间隔超时
TimeOuts.ReadTotalTimeoutMultiplier = 0; // 读时间系数
TimeOuts.ReadTotalTimeoutConstant = 1; // 读时间常量
TimeOuts.ReadTotalTimeoutMultiplier = 0; // 读时间系数
TimeOuts.ReadTotalTimeoutConstant = 1; // 读时间常量
SetCommTimeouts(m_CommHandler, &TimeOuts);
// PurgeComm(m_CommHandler, PURGE_RXCLEAR);

Loading…
Cancel
Save