serial: async_to_irq: update `tx_ready` return

The async IRQ shim supports writes of any size up to the TX buffer size.

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2024-04-01 15:53:50 +10:00 committed by Alberto Escolar
parent 81352d011f
commit 3e5c72a0ee
1 changed files with 3 additions and 1 deletions

View File

@ -263,8 +263,10 @@ void z_uart_async_to_irq_irq_tx_disable(const struct device *dev)
int z_uart_async_to_irq_irq_tx_ready(const struct device *dev)
{
struct uart_async_to_irq_data *data = get_data(dev);
bool ready = (data->flags & A2I_TX_IRQ_ENABLED) && !(data->flags & A2I_TX_BUSY);
return (data->flags & A2I_TX_IRQ_ENABLED) && !(data->flags & A2I_TX_BUSY);
/* async API handles arbitrary sizes */
return ready ? data->tx.len : 0;
}
/** Interrupt driven receiver enabling function */