start refactoring transmitting

This commit is contained in:
Wolfgang Hottgenroth 2020-11-25 12:36:36 +01:00
parent b328e41984
commit e1640be4c0
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -265,10 +265,16 @@ void mbusCommISR() {
// RXNEIE doesn't need to be considered since it is always on and more over the // RXNEIE doesn't need to be considered since it is always on and more over the
// RXNE flag is cleared by reading the DR, which is done in any case // RXNE flag is cleared by reading the DR, which is done in any case
if (((isrflags & USART_SR_RXNE) != RESET) || ((isrflags & USART_SR_ORE) != RESET)) { if (((isrflags & USART_SR_RXNE) != RESET) || ((isrflags & (USART_SR_ORE | USART_SR_FE | USART_SR_PE)) != RESET)) {
if ((isrflags & USART_SR_ORE) != RESET) { if ((isrflags & USART_SR_ORE) != RESET) {
mbusCommStats.uartOverrunCnt += 1; mbusCommStats.uartOverrunCnt += 1;
} }
if ((isrflags & USART_SR_FE) != RESET) {
mbusCommStats.uartFramingErrCnt += 1;
}
if ((isrflags & USART_SR_PE) != RESET) {
mbusCommStats.uartParityErrCnt += 1;
}
// it is required to read the DR in any case here, not only when the buffer has space // 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 // otherwise the interrupt flag won't be disabled, particularly important in case of
// ORE // ORE
@ -291,14 +297,6 @@ void mbusCommISR() {
} }
} }
} }
if ((isrflags & USART_SR_FE) != RESET) {
mbusCommStats.uartFramingErrCnt += 1;
}
if ((isrflags & USART_SR_PE) != RESET) {
mbusCommStats.uartParityErrCnt += 1;
}
} }