From 29e67fc201a1e4bcf7675be9ccac821b3a223bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Mon, 25 Nov 2024 15:29:25 +0100 Subject: [PATCH] treewide: Align to nrfx 3.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align code to the changes in nrfx 3.9.0. Signed-off-by: Karol Lasończyk --- .../peripheral_power_profiling/src/main.c | 5 ----- subsys/esb/esb.c | 16 ++++++++++++++++ subsys/esb/esb_dppi.c | 12 ++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/samples/bluetooth/peripheral_power_profiling/src/main.c b/samples/bluetooth/peripheral_power_profiling/src/main.c index 90beb30c51e0..7baec72d1cc2 100644 --- a/samples/bluetooth/peripheral_power_profiling/src/main.c +++ b/samples/bluetooth/peripheral_power_profiling/src/main.c @@ -644,12 +644,7 @@ static void reset_reason_print(void) printk("Wake up by NFC field detected\n"); } else if (reason & NRFX_RESET_REASON_OFF_MASK) { printk("Wake up by the advertising start buttons\n"); -/* Workaround for typo in the NRFX. */ -#if !NRF_POWER_HAS_RESETREAS - } else if (reason & NRFX_RESETREAS_SREQ_MASK) { -#else } else if (reason & NRFX_RESET_REASON_SREQ_MASK) { -#endif printk("Application soft reset detected\n"); } else if (reason & NRFX_RESET_REASON_RESETPIN_MASK) { printk("Reset from pin-reset\n"); diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index 90d1ac2b3e8c..6bc4f32d0aa8 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -445,7 +445,11 @@ static void esb_fem_for_tx_ack(void) static void esb_fem_reset(void) { +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_STOP); +#endif mpsl_fem_lna_configuration_clear(); mpsl_fem_pa_configuration_clear(); @@ -458,7 +462,11 @@ static void esb_fem_reset(void) static void esb_fem_lna_reset(void) { +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_STOP); +#endif esb_ppi_for_fem_clear(); @@ -470,7 +478,11 @@ static void esb_fem_pa_reset(void) { mpsl_fem_pa_configuration_clear(); +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_STOP); +#endif esb_ppi_for_fem_clear(); mpsl_fem_disable(); @@ -1289,7 +1301,11 @@ static void on_radio_disabled_tx_wait_for_ack(void) } } else { if (retransmits_remaining-- == 0) { +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_task_trigger(esb_timer.p_reg, NRF_TIMER_TASK_STOP); +#endif /* All retransmits are expended, and the TX operation is * suspended diff --git a/subsys/esb/esb_dppi.c b/subsys/esb/esb_dppi.c index f5f7a3dc73c8..f1642d1c6037 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -150,8 +150,14 @@ void esb_ppi_for_wait_for_ack_set(void) nrf_timer_publish_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0, timer_compare0_radio_disable); +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN, radio_address_timer_stop); +#else + nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_STOP, + radio_address_timer_stop); +#endif + nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_DISABLE, timer_compare0_radio_disable); channels_mask = (BIT(radio_address_timer_stop) | @@ -172,7 +178,13 @@ void esb_ppi_for_wait_for_ack_clear(void) nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS); nrf_timer_publish_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0); +#if defined(TIMER_TASKS_SHUTDOWN_TASKS_SHUTDOWN_Msk) nrf_timer_subscribe_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); +#else + nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_STOP, + radio_address_timer_stop); +#endif + nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_DISABLE); }