From a7fff7445cd34d8388c13fcee430635252bcb044 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 6 Jul 2024 02:06:36 +0200 Subject: [PATCH] Bluetooth: Controller: Fix ext conn create when using single timer Fix Extended Connection Creation when using single timer feature in the Controller. Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 9 +++++++++ .../controller/ll_sw/nordic/hal/nrf5/radio/radio.h | 1 + .../bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index 73b4fbbdd3d..3bccb06d344 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -646,6 +646,15 @@ uint32_t radio_is_done(void) } #endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ +uint32_t radio_is_tx_done(void) +{ + if (IS_ENABLED(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)) { + return radio_is_done(); + } else { + return 1U; + } +} + uint32_t radio_has_disabled(void) { return (NRF_RADIO->EVENTS_DISABLED != 0); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h index f2a99cfc552..bebd256eed6 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h @@ -86,6 +86,7 @@ void radio_status_reset(void); uint32_t radio_is_ready(void); uint32_t radio_is_address(void); uint32_t radio_is_done(void); +uint32_t radio_is_tx_done(void); uint32_t radio_has_disabled(void); uint32_t radio_is_idle(void); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c index de7179bd886..e3d7b8b4f33 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c @@ -477,6 +477,11 @@ static void isr_tx_rx(void *param) node_rx_prof = lll_prof_reserve(); } + /* Call to ensure packet/event timer accumulates the elapsed time + * under single timer use. + */ + (void)radio_is_tx_done(); + /* Clear radio tx status and events */ lll_isr_tx_status_reset();