Skip to content

Commit 6110ee4

Browse files
cvinayaknordicjm
authored andcommitted
[nrf fromtree] Bluetooth: Controller: Fix single switch timer use in ISO Sync
Fix implementation of Broadcast ISO Synchronized Receiver using single switch timer to consider minimum compare value requirement. This fix reduces latencies to setup radio receptions and fixes an assertion in lll_sync_iso when radio_tmr_start_us() is checked for latencies. Relates to commit 5dfc58c ("Bluetooth: Controller: Fix single switch timer minimum compare value"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 8eae0bf) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 2e9357a commit 6110ee4

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,22 +1352,25 @@ static void isr_rx(void *param)
13521352
hcto -= addr_us_get(lll->phy);
13531353
hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
13541354

1355-
overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
1356-
overhead_us += addr_us_get(lll->phy);
1357-
overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
1355+
/* Overhead within EVENT_IFS_US to exclude from max. jitter */
1356+
/* Required radio ready duration, settling time */
1357+
overhead_us = radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
1358+
/* If single timer used, then consider required max. latency */
1359+
overhead_us += HAL_RADIO_ISR_LATENCY_MAX_US;
1360+
/* Add chain delay overhead */
1361+
overhead_us += radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
1362+
/* Add base clock jitter overhead */
13581363
overhead_us += (EVENT_CLOCK_JITTER_US << 1);
1359-
13601364
LL_ASSERT(EVENT_IFS_US > overhead_us);
13611365

1366+
/* Max. available clock jitter */
13621367
jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1;
1368+
/* Max. clock jitter per subevent */
13631369
jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse);
1364-
overhead_us = HAL_RADIO_TMR_START_DELAY_US;
1365-
if (jitter_max_us > overhead_us) {
1366-
jitter_max_us -= overhead_us;
1367-
} else {
1368-
jitter_max_us = 0U;
1369-
}
1370+
/* Min. clock jitter we shall use */
1371+
jitter_max_us = MAX(jitter_max_us, (EVENT_CLOCK_JITTER_US << 1));
13701372

1373+
/* Jitter for current subevent */
13711374
jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse;
13721375
if (jitter_us > jitter_max_us) {
13731376
jitter_us = jitter_max_us;

0 commit comments

Comments
 (0)