From 9f5eb0f1a81bf3a92b8d5e376be7c48b2d49d13d Mon Sep 17 00:00:00 2001 From: Erik Brockhoff Date: Wed, 30 Nov 2022 11:15:51 +0100 Subject: [PATCH] Bluetooth: controller: fixup to peripheral CIS Create check instant In case a CIS is the first in a CIG, we should start ISO peripheral early to allow small CIS offsets Signed-off-by: Erik Brockhoff --- subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c index 2824e830196..abd9f0e9211 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c @@ -432,8 +432,19 @@ static void rp_cc_check_instant(struct ll_conn *conn, struct proc_ctx *ctx, uint void *param) { uint16_t start_event_count; + struct ll_conn_iso_group *cig; + cig = ll_conn_iso_group_get_by_id(ctx->data.cis_create.cig_id); start_event_count = ctx->data.cis_create.conn_event_count; + LL_ASSERT(cig); + + if (!cig->started) { + /* Start ISO peripheral one event before the requested instant + * for first CIS. This is done to be able to accept small CIS + * offsets. + */ + start_event_count--; + } if (is_instant_reached_or_passed(start_event_count, cc_event_counter(conn))) {