mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-11 17:46:00 +00:00
Although it is not clearly specified in the UART API, this function is supposed to return 0 when the TX interrupt is disabled, regardless of whether anything could fit into the TX buffer or not (this can be concluded from looking at implementations of several samples and tests present in the tree, also almost all UART drivers are implemented this way). The problem in the uart_nrfx_uarte driver case is that the flag that allows generation of the TX interrupt is not cleared directly in the uart_irq_tx_disable() function but this clearing is deferred to the end of the current transmission, in case one is in progress, and hence it is done in the interrupt handler. Consequently, when the interrupt handler is not entered between calls to uart_irq_tx_disable() and uart_irq_tx_ready() (e.g. when both functions are called in a loop executed in the interrupt context), the latter may return an invalid value. Fix this problem by additionally checking if the TX interrupt was requested to be disabled, not only if it is already disabled in hardware. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no> |
||
---|---|---|
.. | ||
adc | ||
audio | ||
bluetooth | ||
can | ||
clock_control | ||
console | ||
counter | ||
crypto | ||
dac | ||
debug | ||
display | ||
dma | ||
eeprom | ||
entropy | ||
espi | ||
ethernet | ||
flash | ||
gpio | ||
hwinfo | ||
i2c | ||
i2s | ||
ieee802154 | ||
interrupt_controller | ||
ipm | ||
kscan | ||
led | ||
led_strip | ||
lora | ||
modem | ||
net | ||
neural_net | ||
pcie | ||
peci | ||
pinmux | ||
ps2 | ||
ptp_clock | ||
pwm | ||
sensor | ||
serial | ||
spi | ||
timer | ||
usb | ||
video | ||
watchdog | ||
wifi | ||
CMakeLists.txt | ||
Kconfig |