Skip to content

Commit

Permalink
Improved the previous fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dc42 committed Dec 23, 2022
1 parent f8fbf58 commit f2d14fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/SAME5x_C21/SAME5x/SerialCDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ int SerialCDC::available() noexcept

void SerialCDC::flush() noexcept
{
while (isConnected && !txBuffer.IsEmpty()) { }
//TODO wait until no data in the USB buffer
while (isConnected && (sending || !txBuffer.IsEmpty())) { }
}

size_t SerialCDC::canWrite() noexcept
Expand Down

0 comments on commit f2d14fd

Please sign in to comment.