Bluetooth: controller: Fix EVENT_OVERHEAD_START_US jitter

As EVENT_OVERHEAD_START_US offset is used in ticks unit in
LLL, ULL scheduling using ticker should also use ticks unit
for EVENT_OVERHEAD_START_US when reducing the first
connection event preparation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2021-05-18 10:41:03 +05:30 committed by Carles Cufí
parent 8cfbaf5d55
commit 858dc7fab4
4 changed files with 4 additions and 8 deletions

View File

@ -784,17 +784,16 @@ void ull_master_setup(struct node_rx_hdr *rx, struct node_rx_ftr *ftr,
ticks_slot_offset = MAX(conn->ull.ticks_active_to_start,
conn->ull.ticks_prepare_to_start);
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = ticks_slot_offset;
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_offset += HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US);
conn_interval_us = lll->interval * CONN_INT_UNIT_US;
conn_offset_us = ftr->radio_end_us;
conn_offset_us += EVENT_TICKER_RES_MARGIN_US;
conn_offset_us -= EVENT_OVERHEAD_START_US;
#if defined(CONFIG_BT_CTLR_PHY)
conn_offset_us -= lll_radio_tx_ready_delay_get(lll->phy_tx,

View File

@ -287,7 +287,6 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx)
ready_delay_us = lll_radio_rx_ready_delay_get(lll->phy, 1);
aux_offset_us -= EVENT_OVERHEAD_START_US;
aux_offset_us -= EVENT_JITTER_US;
aux_offset_us -= ready_delay_us;
aux_offset_us -= window_widening_us;
@ -307,12 +306,12 @@ void ull_scan_aux_setup(memq_link_t *link, struct node_rx_hdr *rx)
ticks_slot_offset = MAX(aux->ull.ticks_active_to_start,
aux->ull.ticks_prepare_to_start);
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = ticks_slot_offset;
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_offset += HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US);
/* TODO: unreserve the primary scan window ticks in ticker */

View File

@ -350,19 +350,18 @@ void ull_slave_setup(struct node_rx_hdr *rx, struct node_rx_ftr *ftr,
ticks_slot_offset = MAX(conn->ull.ticks_active_to_start,
conn->ull.ticks_prepare_to_start);
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = ticks_slot_offset;
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_offset += HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US);
conn_interval_us -= lll->slave.window_widening_periodic_us;
conn_offset_us = ftr->radio_end_us;
conn_offset_us += win_offset * CONN_INT_UNIT_US;
conn_offset_us += win_delay_us;
conn_offset_us -= EVENT_OVERHEAD_START_US;
conn_offset_us -= EVENT_TICKER_RES_MARGIN_US;
conn_offset_us -= EVENT_JITTER_US;
conn_offset_us -= ready_delay_us;

View File

@ -439,7 +439,6 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux,
/* offs_adjust may be 1 only if sync setup by LL_PERIODIC_SYNC_IND */
sync_offset_us += (si->offs_adjust ? OFFS_ADJUST_US : 0U);
sync_offset_us -= PKT_AC_US(pdu->len, 0, lll->phy);
sync_offset_us -= EVENT_OVERHEAD_START_US;
sync_offset_us -= EVENT_TICKER_RES_MARGIN_US;
sync_offset_us -= EVENT_JITTER_US;
sync_offset_us -= ready_delay_us;
@ -461,12 +460,12 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux,
ticks_slot_offset = MAX(sync->ull.ticks_active_to_start,
sync->ull.ticks_prepare_to_start);
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = ticks_slot_offset;
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_offset += HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_START_US);
ret = ticker_start(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH,
(TICKER_ID_SCAN_SYNC_BASE + sync_handle),