start refactoring transmitting
This commit is contained in:
parent
b328e41984
commit
e1640be4c0
@ -265,10 +265,16 @@ void mbusCommISR() {
|
||||
|
||||
// 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
|
||||
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) {
|
||||
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
|
||||
// otherwise the interrupt flag won't be disabled, particularly important in case of
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user