-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
During a PR review, some confusion about the expected behavior of the uart_irq_tx_ready function popped out, see this comment and replies to it.
Apparently, some existing Zephyr code expects this function to return true only when the TX interrupt is enabled (see for instance drivers/bluetooth/hci/h4.c or subsys/shell/shell_uart.c) and this function returning true is even treated as an indication that some TX action should be done, while from reading the API description one can conclude that this only indicates that TX action is possible because "UART TX buffer can accept at least one character for transmission".
Indeed, most of UART drivers implement this function in the way described above, but some exceptions seems to be also present (see uart_stm32.c). And the basic UART API test seems to also not follow this approach.
To avoid further confusion, it should be clarified what is the actually required behavior of the function.