Skip to content

Commit e4b6751

Browse files
cvinayakkartben
authored andcommitted
Bluetooth: Controller: Restrict ISO Sync Receiver subevent jitter
Restrict the jitter considered in the PDU reception in the subevents of ISO Sync Receiver. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 06b7503 commit e4b6751

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,9 @@ static void isr_rx(void *param)
10921092
/* Setup radio packet timer header complete timeout for
10931093
* subsequent subevent PDU.
10941094
*/
1095+
uint32_t jitter_max_us;
1096+
uint32_t overhead_us;
1097+
uint32_t jitter_us;
10951098

10961099
/* Calculate the radio start with consideration of the drift
10971100
* based on the access address capture timestamp.
@@ -1102,7 +1105,17 @@ static void isr_rx(void *param)
11021105
hcto -= radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
11031106
hcto -= addr_us_get(lll->phy);
11041107
hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
1105-
hcto -= (EVENT_CLOCK_JITTER_US << 1) * nse;
1108+
overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8);
1109+
overhead_us += addr_us_get(lll->phy);
1110+
overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8);
1111+
overhead_us += (EVENT_CLOCK_JITTER_US << 1);
1112+
jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1;
1113+
jitter_max_us -= RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US;
1114+
jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse;
1115+
if (jitter_us > jitter_max_us) {
1116+
jitter_us = jitter_max_us;
1117+
}
1118+
hcto -= jitter_us;
11061119

11071120
start_us = hcto;
11081121
hcto = radio_tmr_start_us(0U, start_us);
@@ -1112,8 +1125,8 @@ static void isr_rx(void *param)
11121125
* 4 us early and subevents could have a 4 us drift each until
11131126
* the current subevent we are listening.
11141127
*/
1115-
hcto += (((EVENT_CLOCK_JITTER_US << 1) * nse) << 1) +
1116-
RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US;
1128+
hcto += (jitter_us << 1);
1129+
hcto += RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US;
11171130
} else {
11181131
/* First subevent PDU was not received, hence setup radio packet
11191132
* timer header complete timeout from where the first subevent

0 commit comments

Comments
 (0)