Skip to content

Commit

Permalink
[nrf noup] boot/zephyr/nrf_cleanup: clean-up only if needed
Browse files Browse the repository at this point in the history
clean-up UARTE only if its driver was enabled

Signed-off-by: Andrzej Puzdrowski <[email protected]>
  • Loading branch information
nvlsianpu committed Mar 6, 2024
1 parent 7310e4f commit 13284bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions boot/zephyr/nrf_cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 13284bc

Please sign in to comment.