start refactoring transmitting

This commit is contained in:
2020-11-25 12:42:33 +01:00
parent e1640be4c0
commit 8fe627e6b0
4 changed files with 8 additions and 5 deletions

View File

@ -105,7 +105,7 @@ typedef struct {
static t_mbusCommHandle mbusCommHandle = { .requestId = 0, .state = MBCS_IDLE, .retryCnt = 0, .cmd = 0, .addr = 0, .startTime = 0, .receiveCnt = 0, .waitForOctet = false };
static t_mbusCommStats mbusCommStats = { .mbusRequestCnt = 0, .mbusErrorCnt = 0, .uartOverrunCnt = 0, .uartFramingErrCnt = 0, .uartParityErrCnt = 0 };
static t_mbusCommStats mbusCommStats = { .mbusRequestCnt = 0, .mbusErrorCnt = 0, .uartOctetCnt = 0, .uartOverrunCnt = 0, .uartFramingErrCnt = 0, .uartParityErrCnt = 0 };
static bool mbusCommEnabled = true;
@ -275,6 +275,7 @@ void mbusCommISR() {
if ((isrflags & USART_SR_PE) != RESET) {
mbusCommStats.uartParityErrCnt += 1;
}
mbusCommStats.uartOctetCnt += 1;
// it is required to read the DR in any case here, not only when the buffer has space
// otherwise the interrupt flag won't be disabled, particularly important in case of
// ORE