Skip to content

Commit 3bc2462

Browse files
cvinayakkartben
authored andcommitted
Bluetooth: Controller: Fix single timer s/w switch when using DPPI
Fix single timer s/w switch when using DPPI on nRF53/54L where the previous compare register index is incorrect when the base index is a odd numbered DPPI used. The issue is discovered as failing ISO Receiver sample with Coded PHY and single timer use, where the compare base is configured to use the DPPI 3 (instead of 4). Upstream samples do not use single timer for s/w switch, the issue is discovered when adding support for nRF54L which has to use single timer due to the radio only having a single timer. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 37bf99e commit 3bc2462

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static inline void hal_radio_b2b_txen_on_sw_switch(uint8_t compare_reg_index,
432432
HAL_SW_SWITCH_RADIO_ENABLE_PPI_REGISTER_EVT(compare_reg_index) =
433433
HAL_SW_SWITCH_RADIO_ENABLE_PPI_EVT(radio_enable_ppi);
434434

435-
uint8_t prev_ppi_idx = (compare_reg_index + 0x01) & 0x01;
435+
uint8_t prev_ppi_idx = (compare_reg_index + 0x01 - SW_SWITCH_TIMER_EVTS_COMP_BASE) & 0x01;
436436

437437
radio_enable_ppi = HAL_SW_SWITCH_RADIO_ENABLE_PPI(prev_ppi_idx);
438438
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_TXEN, radio_enable_ppi);
@@ -464,7 +464,7 @@ static inline void hal_radio_b2b_rxen_on_sw_switch(uint8_t compare_reg_index,
464464
HAL_SW_SWITCH_RADIO_ENABLE_PPI_REGISTER_EVT(compare_reg_index) =
465465
HAL_SW_SWITCH_RADIO_ENABLE_PPI_EVT(radio_enable_ppi);
466466

467-
uint8_t prev_ppi_idx = (compare_reg_index + 0x01) & 0x01;
467+
uint8_t prev_ppi_idx = (compare_reg_index + 0x01 - SW_SWITCH_TIMER_EVTS_COMP_BASE) & 0x01;
468468

469469
radio_enable_ppi = HAL_SW_SWITCH_RADIO_ENABLE_PPI(prev_ppi_idx);
470470
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_RXEN, radio_enable_ppi);
@@ -492,7 +492,7 @@ static inline void hal_radio_sw_switch_b2b_tx_disable(uint8_t compare_reg_index)
492492
{
493493
hal_radio_sw_switch_disable();
494494

495-
uint8_t prev_ppi_idx = (compare_reg_index + 0x01) & 0x01;
495+
uint8_t prev_ppi_idx = (compare_reg_index + 0x01 - SW_SWITCH_TIMER_EVTS_COMP_BASE) & 0x01;
496496
uint8_t radio_enable_ppi = HAL_SW_SWITCH_RADIO_ENABLE_PPI(prev_ppi_idx);
497497

498498
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_TXEN, radio_enable_ppi);
@@ -502,7 +502,7 @@ static inline void hal_radio_sw_switch_b2b_rx_disable(uint8_t compare_reg_index)
502502
{
503503
hal_radio_sw_switch_disable();
504504

505-
uint8_t prev_ppi_idx = (compare_reg_index + 0x01) & 0x01;
505+
uint8_t prev_ppi_idx = (compare_reg_index + 0x01 - SW_SWITCH_TIMER_EVTS_COMP_BASE) & 0x01;
506506
uint8_t radio_enable_ppi = HAL_SW_SWITCH_RADIO_ENABLE_PPI(prev_ppi_idx);
507507

508508
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_RXEN, radio_enable_ppi);

0 commit comments

Comments
 (0)