提交 b4a9684a 编写于 作者: M mishafarms 提交者: Me No Dev

Fix SerialBT.flush (#3579)

* Fix flush

flush should not flush the read buffer, it should wait till all output is drained from the write buffer.

* Update BluetoothSerial.cpp
Co-authored-by: NMe No Dev <me-no-dev@users.noreply.github.com>
上级 1977370e
......@@ -660,7 +660,11 @@ size_t BluetoothSerial::write(const uint8_t *buffer, size_t size)
void BluetoothSerial::flush()
{
while(read() >= 0){}
if (_spp_tx_queue != NULL){
while(uxQueueMessagesWaiting(_spp_tx_queue) > 0){
delay(5);
}
}
}
void BluetoothSerial::end()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册