From 373dc0db71d1c8741c64e18776feff1633c094b7 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 6 Jul 2024 02:06:36 +0200 Subject: [PATCH] Bluetooth: Controller: Single timer use Extended Advertising nRF54L support Update Extended Advertising for single timer use support required for nRF54L Series SoCs. As the timer is reset on every radio end, add implementation to accumulate the last_pdu_end_us. 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 + subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c | 5 +++++ .../bluetooth/controller/ll_sw/nordic/lll/lll_adv_aux.c | 5 +++++ 4 files changed, 20 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 9595e685fd4..1e10c8e71a8 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 @@ -641,6 +641,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 b655d04e84c..ae334df9af5 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.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index a4b6d0dd3ad..8334f35ebf8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -1303,6 +1303,11 @@ static void isr_done(void *param) { struct lll_adv *lll; + /* Call to ensure packet/event timer accumulates the elapsed time + * under single timer use. + */ + (void)radio_is_tx_done(); + /* Clear radio status and events */ lll_isr_status_reset(); 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 1efbdf432b6..731ca94ed50 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 @@ -581,6 +581,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();