Implemented blocking rx

This commit is contained in:
2019-08-02 17:54:34 +02:00
parent 0bfd303a26
commit 95963295e2
3 changed files with 12 additions and 2 deletions

View File

@@ -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;