Skip to content

Commit

Permalink
treewide: Align to nrfx 3.9.0
Browse files Browse the repository at this point in the history
Align code to the changes in nrfx 3.9.0.

Signed-off-by: Karol Lasończyk <[email protected]>
  • Loading branch information
kl-cruz authored and carlescufi committed Nov 25, 2024
1 parent e69b2d2 commit 29e67fc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
5 changes: 0 additions & 5 deletions samples/bluetooth/peripheral_power_profiling/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
16 changes: 16 additions & 0 deletions subsys/esb/esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();

Expand All @@ -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();
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions subsys/esb/esb_dppi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand All @@ -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);
}

Expand Down

0 comments on commit 29e67fc

Please sign in to comment.