Skip to content

Commit 16e0e66

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Increase BIS PDU access address receive timeout
Increase the BIS PDU access address receive timeout, use the +/- 2 us jitter for each subevent. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 2cea585 commit 16e0e66

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ static void isr_rx(void *param)
428428
uint8_t crc_ok;
429429
uint32_t hcto;
430430
uint8_t bis;
431+
uint8_t nse;
431432
uint8_t bn;
432433

433434
/* Read radio status and events */
@@ -817,10 +818,10 @@ static void isr_rx(void *param)
817818
* microseconds by when a PDU header is to be received for each
818819
* subevent.
819820
*/
820-
hcto = (lll->sub_interval *
821-
(((lll->bis_curr - 1U) * ((lll->bn * lll->irc) + lll->ptc)) +
822-
(((lll->irc_curr - 1U) * lll->bn) + (lll->bn_curr - 1U) +
823-
lll->ptc_curr) + lll->ctrl));
821+
nse = ((lll->bis_curr - 1U) * ((lll->bn * lll->irc) + lll->ptc)) +
822+
((lll->irc_curr - 1U) * lll->bn) + (lll->bn_curr - 1U) +
823+
lll->ptc_curr + lll->ctrl;
824+
hcto = lll->sub_interval * nse;
824825

825826
if (trx_cnt) {
826827
/* Setup radio packet timer header complete timeout for
@@ -841,11 +842,18 @@ static void isr_rx(void *param)
841842
start_us = hcto;
842843
radio_tmr_start_us(0U, start_us);
843844

844-
/* Add 4 us + 4 us, as radio was setup to listen 4 us early */
845-
hcto += (EVENT_CLOCK_JITTER_US << 2);
845+
/* Add 4 us + 4 us + (4 us * subevents so far), as radio
846+
* was setup to listen 4 us early and subevents could have
847+
* a 4 us drift each until the current subevent we are
848+
* listening.
849+
*/
850+
hcto += ((EVENT_CLOCK_JITTER_US << 1) * (2U + nse)) +
851+
RANGE_DELAY_US + HCTO_START_DELAY_US;
846852
} else {
847-
/* Setup radio packet timer header complete timeout for
848-
* first subevent PDU which is the BIG event anchor point.
853+
/* First subevent PDU was not received, hence setup radio packet
854+
* timer header complete timeout from where the first subevent
855+
* PDU which is the BIG event anchor point would have been
856+
* received.
849857
*/
850858
hcto += radio_tmr_ready_restore();
851859

0 commit comments

Comments
 (0)