Added flushing of transmit buffer
This commit is contained in:
@@ -109,6 +109,12 @@ class Hardware1 {
|
||||
return HardwareImpl::peekBlocking();
|
||||
}
|
||||
|
||||
static void flushTx() FORCE_INLINE
|
||||
{
|
||||
while (HardwareImpl::txActive())
|
||||
;
|
||||
}
|
||||
|
||||
private:
|
||||
using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1,
|
||||
detail::ControlFlagsC1, cfg, mode, driven>;
|
||||
@@ -168,6 +174,14 @@ class Hardware1<mode, cfg, Driven::INTERRUPT> {
|
||||
return (sm_rxBuf.head != sm_rxBuf.tail);
|
||||
}
|
||||
|
||||
static void flushTx() FORCE_INLINE
|
||||
{
|
||||
while (sm_txBuf.head != sm_txBuf.tail)
|
||||
;
|
||||
while (HardwareImpl::txActive())
|
||||
;
|
||||
}
|
||||
|
||||
private:
|
||||
using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1,
|
||||
detail::ControlFlagsC1, cfg, mode, Driven::INTERRUPT>;
|
||||
|
||||
Reference in New Issue
Block a user