Stay in loop when RX_L_DATA.

This commit is contained in:
Mike Pieper 2021-12-28 09:06:35 +01:00
parent 910ccae31b
commit 07306ac598

View File

@ -100,11 +100,6 @@ enum {
void TpUartDataLinkLayer::loop() void TpUartDataLinkLayer::loop()
{ {
_receiveBuffer[0] = 0x29;
_receiveBuffer[1] = 0;
uint8_t* buffer = _receiveBuffer + 2;
uint8_t rxByte;
if (!_enabled) if (!_enabled)
{ {
if (millis() - _lastResetChipTime > 1000) if (millis() - _lastResetChipTime > 1000)
@ -118,6 +113,11 @@ void TpUartDataLinkLayer::loop()
if (!_enabled) if (!_enabled)
return; return;
do {
_receiveBuffer[0] = 0x29;
_receiveBuffer[1] = 0;
uint8_t* buffer = _receiveBuffer + 2;
uint8_t rxByte;
bool isEchoComplete = false; // Flag that a complete echo is received bool isEchoComplete = false; // Flag that a complete echo is received
bool dataConnMsg = 0; // The DATA_CONN message just seen or 0 bool dataConnMsg = 0; // The DATA_CONN message just seen or 0
bool isEOP = (millis() - _lastByteRxTime > EOP_TIMEOUT); // Flag that an EOP gap is seen bool isEOP = (millis() - _lastByteRxTime > EOP_TIMEOUT); // Flag that an EOP gap is seen
@ -423,6 +423,7 @@ void TpUartDataLinkLayer::loop()
} }
break; break;
} }
} while (_rxState == RX_L_DATA);
} }
bool TpUartDataLinkLayer::sendFrame(CemiFrame& frame) bool TpUartDataLinkLayer::sendFrame(CemiFrame& frame)