Added flushing of transmit buffer
This commit is contained in:
@@ -105,6 +105,12 @@ class Hardware0 {
|
||||
return HardwareImpl::peekBlocking();
|
||||
}
|
||||
|
||||
static void flushTx() FORCE_INLINE
|
||||
{
|
||||
while (HardwareImpl::txActive())
|
||||
;
|
||||
}
|
||||
|
||||
private:
|
||||
using HardwareImpl = detail::Hardware<detail::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0,
|
||||
detail::ControlFlagsC0, cfg, mode, driven>;
|
||||
@@ -164,6 +170,14 @@ class Hardware0<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::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0,
|
||||
detail::ControlFlagsC0, cfg, mode, Driven::INTERRUPT>;
|
||||
|
||||
Reference in New Issue
Block a user