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: Me No Dev <me-no-dev@users.noreply.github.com>
This commit is contained in:
parent
1977370e6f
commit
b4a9684a74
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user