Added flushing of transmit buffer

This commit is contained in:
2019-08-03 17:52:28 +02:00
parent b6c1c3b51b
commit 9f9f7a8de5
4 changed files with 39 additions and 1 deletions

View File

@@ -64,9 +64,14 @@ class Hardware {
return *Registers::IO_REG;
}
static bool txActive() FORCE_INLINE
{
return !(*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY));
}
static void txByteBlocking(const typename cfg::data_t &byte) FORCE_INLINE
{
while (!(*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY)))
while (txActive())
;
*Registers::IO_REG = byte;