Implemented blocking rx
This commit is contained in:
10
hardware.hpp
10
hardware.hpp
@@ -45,6 +45,16 @@ class Hardware {
|
||||
*Registers::CTRL_STAT_REG_C = controlRegC;
|
||||
}
|
||||
|
||||
static bool rxByteBlocking(typename cfg::data_t &byte) FORCE_INLINE
|
||||
{
|
||||
if (*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::RECEIVE_COMPLETE)) {
|
||||
byte = *Registers::IO_REG;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static typename cfg::data_t rxByteInterrupt() FORCE_INLINE
|
||||
{
|
||||
return *Registers::IO_REG;
|
||||
|
||||
Reference in New Issue
Block a user