Fixed flushing not blocking correctly
This commit is contained in:
16
hardware.hpp
16
hardware.hpp
@@ -64,14 +64,24 @@ class Hardware {
|
||||
return *Registers::IO_REG;
|
||||
}
|
||||
|
||||
static bool txActive() FORCE_INLINE
|
||||
static bool txEmpty() FORCE_INLINE
|
||||
{
|
||||
return !(*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY));
|
||||
return *Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY);
|
||||
}
|
||||
|
||||
static bool txComplete() FORCE_INLINE
|
||||
{
|
||||
return *Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::TRANSMIT_COMPLETE);
|
||||
}
|
||||
|
||||
static void clearTxComplete() FORCE_INLINE
|
||||
{
|
||||
*Registers::CTRL_STAT_REG_A |= (1 << CtrlFlagsA::TRANSMIT_COMPLETE);
|
||||
}
|
||||
|
||||
static void txByteBlocking(const typename cfg::data_t &byte) FORCE_INLINE
|
||||
{
|
||||
while (txActive())
|
||||
while (!txEmpty())
|
||||
;
|
||||
|
||||
*Registers::IO_REG = byte;
|
||||
|
||||
Reference in New Issue
Block a user