diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync.c b/subsys/bluetooth/controller/ll_sw/ull_sync.c index 18ec492621..93d0b88f72 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync.c @@ -673,6 +673,7 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, uint32_t interval_us; struct pdu_adv *pdu; uint16_t interval; + uint32_t slot_us; uint8_t chm_last; uint32_t ret; uint8_t sca; @@ -820,16 +821,22 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux, interval_us -= lll->window_widening_periodic_us; + /* Calculate event time reservation */ + slot_us = PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, lll->phy); + slot_us += ready_delay_us; + + /* Add implementation defined radio event overheads */ + if (IS_ENABLED(CONFIG_BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX)) { + slot_us += EVENT_OVERHEAD_START_US + EVENT_OVERHEAD_END_US; + } + /* TODO: active_to_start feature port */ sync->ull.ticks_active_to_start = 0U; sync->ull.ticks_prepare_to_start = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US); sync->ull.ticks_preempt_to_start = HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US); - sync->ull.ticks_slot = HAL_TICKER_US_TO_TICKS_CEIL( - EVENT_OVERHEAD_START_US + ready_delay_us + - PDU_AC_MAX_US(PDU_AC_EXT_PAYLOAD_RX_SIZE, lll->phy) + - EVENT_OVERHEAD_END_US); + sync->ull.ticks_slot = HAL_TICKER_US_TO_TICKS_CEIL(slot_us); ticks_slot_offset = MAX(sync->ull.ticks_active_to_start, sync->ull.ticks_prepare_to_start);