ignore null telegrams

This commit is contained in:
proddy
2019-03-24 19:45:59 +01:00
parent 7af42ac8ae
commit 8b0d91a9b8
2 changed files with 15 additions and 19 deletions

View File

@@ -71,14 +71,9 @@ static void emsuart_rx_intr_handler(void * para) {
* The full buffer is sent to the ems_parseTelegram() function in ems.cpp.
*/
static void ICACHE_FLASH_ATTR emsuart_recvTask(os_event_t * events) {
// get next free EMS Receive buffer
_EMSRxBuf * pCurrent = pEMSRxBuf;
pEMSRxBuf = paEMSRxBuf[++emsRxBufIdx % EMS_MAXBUFFERS];
// transmit EMS buffer, excluding the BRK
if (pCurrent->writePtr > 1) {
ems_parseTelegram((uint8_t *)pCurrent->buffer, (pCurrent->writePtr) - 1);
}
ems_parseTelegram((uint8_t *)pCurrent->buffer, (pCurrent->writePtr) - 1); // transmit EMS buffer, excluding the BRK
pEMSRxBuf = paEMSRxBuf[++emsRxBufIdx % EMS_MAXBUFFERS]; // next free EMS Receive buffer
}
/*