Skip to content

Commit 805d467

Browse files
committed
[nrf fromlist] drivers: serial: nrfx_uarte2: Fix handling of errors
Fix case when interrupt driven API did not enable error interrupt and error occurs. Previously in that case error state was kept so device remained in a state in which it was expecting higher layer to read and clear error state by calling uart_err_check(). If error interrupt is not enabled it will never occur and in that case error information shall be dropped. Upstream PR: zephyrproject-rtos/zephyr#74643 Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent d5abd35 commit 805d467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/serial/uart_nrfx_uarte2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void on_rx_done(const struct device *dev, const nrfx_uarte_event_t *event
248248
evt.data.rx_stop.data.buf = event->data.rx.p_buffer;
249249
evt.data.rx_stop.data.len = event->data.rx.length;
250250
/* Keep error code for uart_err_check(). */
251-
if (!IS_INT_DRIVEN_API(dev)) {
251+
if (!IS_INT_DRIVEN_API(dev) || !uart_async_to_irq_err_enabled(dev)) {
252252
data->async->err = 0;
253253
}
254254
data->async->user_callback(dev, &evt, data->async->user_data);

0 commit comments

Comments
 (0)