start refactoring transmitting
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user