Skip to content

Commit ab90285

Browse files
committed
drivers: uart_nrfx_uart{,e}: on clear async pointers when enabled
Fix a build error introduced in 9f02eea, the async pointers are only available when UARTE_ANY_ASYNC is set. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1 parent 1b905fd commit ab90285

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/serial/uart_nrfx_uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static int uart_nrfx_callback_set(const struct device *dev,
405405
uart0_cb.callback = callback;
406406
uart0_cb.user_data = user_data;
407407

408-
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
408+
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS) && defined(CONFIG_UART_0_INTERRUPT_DRIVEN)
409409
irq_callback = NULL;
410410
irq_cb_data = NULL;
411411
#endif
@@ -929,7 +929,7 @@ static void uart_nrfx_irq_callback_set(const struct device *dev,
929929
irq_callback = cb;
930930
irq_cb_data = cb_data;
931931

932-
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
932+
#if defined(CONFIG_UART_0_ASYNC) && defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
933933
uart0_cb.callback = NULL;
934934
uart0_cb.user_data = NULL;
935935
#endif

drivers/serial/uart_nrfx_uarte.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ static int uarte_nrfx_callback_set(const struct device *dev,
937937
data->async->user_callback = callback;
938938
data->async->user_data = user_data;
939939

940-
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
940+
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS) && defined(UARTE_INTERRUPT_DRIVEN)
941941
data->int_driven->cb = NULL;
942942
data->int_driven->cb_data = NULL;
943943
#endif
@@ -1681,7 +1681,7 @@ static void uarte_nrfx_irq_callback_set(const struct device *dev,
16811681
data->int_driven->cb = cb;
16821682
data->int_driven->cb_data = cb_data;
16831683

1684-
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
1684+
#if defined(UARTE_ANY_ASYNC) && defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
16851685
data->async->user_callback = NULL;
16861686
data->async->user_data = NULL;
16871687
#endif

0 commit comments

Comments
 (0)