mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Purge read and write queues after a close succeeds
This commit is contained in:
@@ -99,10 +99,16 @@ bool FTDI::close() {
|
||||
|
||||
closing = false;
|
||||
|
||||
bool ret = true;
|
||||
if(ftdiDevice.close())
|
||||
return false;
|
||||
ret = false;
|
||||
|
||||
return true;
|
||||
uint8_t flush;
|
||||
WriteOperation flushop;
|
||||
while(readQueue.try_dequeue(flush)) {}
|
||||
while(writeQueue.try_dequeue(flushop)) {}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FTDI::readTask() {
|
||||
|
||||
Reference in New Issue
Block a user