Skip to content

Commit

Permalink
Bluetooth: Controller: Fix offset_min_us be >= PDU_CIS_OFFSET_MIN_US
Browse files Browse the repository at this point in the history
Fix calculation that ensured cis_offset_min_us being >=
PDU_CIS_OFFSET_MIN_US.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak authored and carlescufi committed Jun 29, 2023
1 parent 5876cc5 commit 6da521c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/controller/ll_sw/ull_central_iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ static void mfy_cig_offset_get(void *param)
conn = ll_conn_get(cis->lll.acl_handle);

conn_interval_us = (uint32_t)conn->lll.interval * CONN_INT_UNIT_US;
while (offset_min_us > (conn_interval_us + PDU_CIS_OFFSET_MIN_US)) {
while (offset_min_us >= (conn_interval_us + PDU_CIS_OFFSET_MIN_US)) {
offset_min_us -= conn_interval_us;
}

Expand Down Expand Up @@ -1044,7 +1044,7 @@ static void mfy_cis_offset_get(void *param)

/* Compensate for the difference between ACL elapsed vs CIG elapsed */
offset_min_us += elapsed_cig_us - elapsed_acl_us;
while (offset_min_us > (cig_interval_us + PDU_CIS_OFFSET_MIN_US)) {
while (offset_min_us >= (cig_interval_us + PDU_CIS_OFFSET_MIN_US)) {
offset_min_us -= cig_interval_us;
}

Expand Down

0 comments on commit 6da521c

Please sign in to comment.