Skip to content

Commit

Permalink
serial: uart_nrfx_*: update tx_ready return codes
Browse files Browse the repository at this point in the history
Update nrfx drivers with the minimum number of bytes that can be sent
in a single call to `uart_fifo_fill`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
  • Loading branch information
JordanYates committed Jul 29, 2024
1 parent e3265e3 commit 9c8c211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions drivers/serial/uart_nrfx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,11 @@ static int uart_nrfx_irq_tx_ready_complete(const struct device *dev)
* called after the TX interrupt is requested to be disabled but before
* the disabling is actually performed (in the IRQ handler).
*/
return nrf_uart_int_enable_check(uart0_addr,
NRF_UART_INT_MASK_TXDRDY) &&
!disable_tx_irq &&
event_txdrdy_check();
bool ready = nrf_uart_int_enable_check(uart0_addr,
NRF_UART_INT_MASK_TXDRDY) &&
!disable_tx_irq &&
event_txdrdy_check();
return ready ? INT_MAX : 0;
}

/** Interrupt driven receiver ready function */
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ static int uarte_nrfx_irq_tx_ready_complete(const struct device *dev)
data->int_driven->fifo_fill_lock = 0;
}

return ready;
return ready ? data->int_driven->tx_buff_size : 0;
}

static int uarte_nrfx_irq_rx_ready(const struct device *dev)
Expand Down

0 comments on commit 9c8c211

Please sign in to comment.