Skip to content

Commit fc813d9

Browse files
segerlundjhedberg
authored andcommitted
Bluetooth: Controller: Handle overlapping CIG and ACL
If the CIG and ACL overlap each other when the CIS is starting zephyr will assert on negative time, so fit this special case. Signed-off-by: Lars Segerlund <[email protected]>
1 parent 1a4f113 commit fc813d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn_iso.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,17 @@ void ull_conn_iso_start(struct ll_conn *conn, uint16_t cis_handle,
979979
lost_cig_events = 1U;
980980
cis_offset = cis->offset + iso_interval_us - acl_latency_us;
981981
}
982+
/* Correct the cis_offset to next CIG event, if the ACL and CIG overlaps.
983+
* ACL radio event at the instant was skipped and a relative CIS offset at
984+
* the current ACL event has been calculated. But the current ACL event
985+
* is partially overlapping with the other of CISes (not yet established) in
986+
* the CIG event. Hence, lets establish the CIS at the next ISO interval so
987+
* as to have a positive CIG event offset.
988+
*/
989+
if (cis_offset < (cig->sync_delay - cis->sync_delay)) {
990+
cis_offset += iso_interval_us;
991+
lost_cig_events++;
992+
}
982993

983994
cis->lll.event_count_prepare += lost_cig_events;
984995

0 commit comments

Comments
 (0)