From 87b6c49c75e46e4daa379e3f61644b9b8fe14c7e Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Wed, 6 Mar 2024 14:32:33 +0100 Subject: [PATCH] [nrf noup] boot/zephyr/nrf_cleanup: clean-up only if needed clean-up UARTE only if its driver was enabled Signed-off-by: Andrzej Puzdrowski --- boot/zephyr/nrf_cleanup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/zephyr/nrf_cleanup.c b/boot/zephyr/nrf_cleanup.c index dbaed69b6..192fc4883 100644 --- a/boot/zephyr/nrf_cleanup.c +++ b/boot/zephyr/nrf_cleanup.c @@ -47,7 +47,7 @@ static void nrf_cleanup_clock(void) nrf_clock_int_disable(NRF_CLOCK, 0xFFFFFFFF); } -#if defined(NRF_UARTE0) || defined(NRF_UARTE1) +#if (defined(NRF_UARTE0) || defined(NRF_UARTE1)) && defined(CONFIG_UART_NRFX_UARTE) static void uninit_used_uarte(NRF_UARTE_Type *p_reg) { uint32_t pin[4]; @@ -86,10 +86,10 @@ void nrf_cleanup_peripheral(void) #if defined(NRF_RTC2) nrf_cleanup_rtc(NRF_RTC2); #endif -#if defined(NRF_UARTE0) +#if defined(NRF_UARTE0)) && defined(CONFIG_UART_NRFX_UARTE) uninit_used_uarte(NRF_UARTE0); #endif -#if defined(NRF_UARTE1) +#if defined(NRF_UARTE1)) && defined(CONFIG_UART_NRFX_UARTE) uninit_used_uarte(NRF_UARTE1); #endif #if defined(NRF_PPI)