Skip to content

Commit 1273947

Browse files
committed
Bluetooth: Controller: Fix ISO Sync Receiver subevent jitter
Fix the jitter considered in the PDU reception in the subevents of ISO Sync Receiver to not exceed such that the reception is scheduled late (causing assertion). Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent 7837f5e commit 1273947

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,16 +1344,30 @@ static void isr_rx(void *param)
13441344
hcto -= radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
13451345
hcto -= addr_us_get(lll->phy);
13461346
hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
1347+
13471348
overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
13481349
overhead_us += addr_us_get(lll->phy);
13491350
overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
13501351
overhead_us += (EVENT_CLOCK_JITTER_US << 1);
1352+
1353+
LL_ASSERT(EVENT_IFS_US > overhead_us);
1354+
13511355
jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1;
1352-
jitter_max_us -= RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US;
1356+
jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse);
1357+
overhead_us = HAL_RADIO_TMR_START_DELAY_US;
1358+
if (jitter_max_us > overhead_us) {
1359+
jitter_max_us -= overhead_us;
1360+
} else {
1361+
jitter_max_us = 0U;
1362+
}
1363+
13531364
jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse;
13541365
if (jitter_us > jitter_max_us) {
13551366
jitter_us = jitter_max_us;
13561367
}
1368+
1369+
LL_ASSERT(hcto > jitter_us);
1370+
13571371
hcto -= jitter_us;
13581372

13591373
start_us = hcto;
@@ -1365,7 +1379,6 @@ static void isr_rx(void *param)
13651379
* the current subevent we are listening.
13661380
*/
13671381
hcto += (jitter_us << 1);
1368-
hcto += RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US;
13691382
} else {
13701383
/* First subevent PDU was not received, hence setup radio packet
13711384
* timer header complete timeout from where the first subevent

0 commit comments

Comments
 (0)