Fixed flushing not blocking correctly

This commit is contained in:
2019-08-03 18:45:51 +02:00
parent 9f9f7a8de5
commit 8153696309
3 changed files with 29 additions and 7 deletions

View File

@@ -111,8 +111,11 @@ class Hardware1 {
static void flushTx() FORCE_INLINE
{
while (HardwareImpl::txActive())
while (!HardwareImpl::txEmpty())
;
while (!HardwareImpl::txComplete())
;
HardwareImpl::clearTxComplete();
}
private:
@@ -178,8 +181,11 @@ class Hardware1<mode, cfg, Driven::INTERRUPT> {
{
while (sm_txBuf.head != sm_txBuf.tail)
;
while (HardwareImpl::txActive())
while (!HardwareImpl::txEmpty())
;
while (!HardwareImpl::txComplete())
;
HardwareImpl::clearTxComplete();
}
private: