start refactoring transmitting
This commit is contained in:
parent
4bae6dce3c
commit
3e31693cf8
@ -261,6 +261,8 @@ void mbusCommISR() {
|
||||
uint32_t isrflags = READ_REG(mbusUart.Instance->SR);
|
||||
uint32_t cr1its = READ_REG(mbusUart.Instance->CR1);
|
||||
|
||||
// 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_ORE) != RESET) {
|
||||
mbusCommStats.uartOverrunCnt += 1;
|
||||
@ -275,8 +277,9 @@ void mbusCommISR() {
|
||||
}
|
||||
}
|
||||
|
||||
// TXEIE needs to be considered since TXE is cleared by writing the DR, which isn't done
|
||||
// after the last octet sent
|
||||
if (((isrflags & USART_SR_TXE) != RESET) && ((cr1its & USART_CR1_TXEIE) != RESET)) {
|
||||
coloredMsg(LOG_RED, false, "TXE");
|
||||
if (mbusCommHandle.sendBuffer.readIdx < mbusCommHandle.sendBuffer.writeIdx) {
|
||||
mbusUart.Instance->DR = mbusCommHandle.sendBuffer.buffer[mbusCommHandle.sendBuffer.readIdx];
|
||||
mbusCommHandle.sendBuffer.readIdx += 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user