From 13284bc893958944a6ca315a5ddb61d52da9939c 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 9aec4bd53..e25a66b55 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]; @@ -85,10 +85,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)