From bcd88a7af136d95d5673588c6841e44e33385ddd Mon Sep 17 00:00:00 2001 From: Chintalagiri Shashank Date: Sat, 12 Oct 2024 19:35:26 +0530 Subject: [PATCH] Minor tweaks --- src/hal_platform/u0xx/uart_handlers.c | 4 +++- src/hal_platform/u0xx/uart_impl.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hal_platform/u0xx/uart_handlers.c b/src/hal_platform/u0xx/uart_handlers.c index bad8706..42c6bb2 100644 --- a/src/hal_platform/u0xx/uart_handlers.c +++ b/src/hal_platform/u0xx/uart_handlers.c @@ -18,12 +18,14 @@ static inline void _uart_handler_fifo(const HAL_BASE_t intfnum); static inline void _uart_handler_tx_norm(const HAL_BASE_t intfnum){ // TXE in single byte mode + uint8_t wbyte; if (bytebuf_cPopulation(uart_if[intfnum]->txbuf) <= 1){ *(HAL_SFR_t *) (uart_if[intfnum]->hwif->base + OFS_UART_CR1) &= ~USART_CR1_TXEIE; uart_if[intfnum]->state->triggered = 0; } if (bytebuf_cPopulation(uart_if[intfnum]->txbuf)) { - *(HAL_SFR_t *) (uart_if[intfnum]->hwif->base + OFS_UART_TDR) = bytebuf_cPopByte(uart_if[intfnum]->txbuf); + wbyte = bytebuf_cPopByte(uart_if[intfnum]->txbuf); + *(HAL_SFR_t *) (uart_if[intfnum]->hwif->base + OFS_UART_TDR) = wbyte; } } diff --git a/src/hal_platform/u0xx/uart_impl.h b/src/hal_platform/u0xx/uart_impl.h index 1063809..c704f6c 100644 --- a/src/hal_platform/u0xx/uart_impl.h +++ b/src/hal_platform/u0xx/uart_impl.h @@ -294,12 +294,12 @@ static inline void uart_discard_rxb(HAL_BASE_t intfnum){ static inline void uart_send_trigger(HAL_BASE_t intfnum){ if (!(uart_if[intfnum]->state->triggered)){ + uart_if[intfnum]->state->triggered = 1; if (uart_if[intfnum]->hwif->fifomode){ * (HAL_SFR_t *) (uart_if[intfnum]->hwif->base + OFS_UART_CR3) |= USART_CR3_TXFTIE; } else { * (HAL_SFR_t *) (uart_if[intfnum]->hwif->base + OFS_UART_CR1) |= USART_CR1_TXEIE; } - uart_if[intfnum]->state->triggered = 1; } }