Skip to content

Commit e48a0af

Browse files
andrzej-kaczmarekkasjer
authored andcommitted
nimble/ll: Prevent BIG event preemption by periodic advertising
This update adjusts the scheduling policy for periodic advertising to ensure it does not preempt BIG events. This ensures stability and performance of audio.
1 parent 4659d19 commit e48a0af

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nimble/controller/src/ble_ll_sched.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ preempt_any_except_conn(struct ble_ll_sched_item *sch,
114114
return ble_ll_conn_is_lru(sch->cb_arg, item->cb_arg);
115115
}
116116

117+
static int
118+
preempt_any_except_big(struct ble_ll_sched_item *sch, struct ble_ll_sched_item *item)
119+
{
120+
if (item->sched_type == BLE_LL_SCHED_TYPE_BIG) {
121+
return 0;
122+
}
123+
124+
return 1;
125+
}
126+
117127
static inline int
118128
ble_ll_sched_check_overlap(struct ble_ll_sched_item *sch1,
119129
struct ble_ll_sched_item *sch2)
@@ -746,7 +756,7 @@ ble_ll_sched_periodic_adv(struct ble_ll_sched_item *sch, bool first_event)
746756
rc = ble_ll_sched_insert(sch, BLE_LL_SCHED_MAX_DELAY_ANY,
747757
preempt_none);
748758
} else {
749-
rc = ble_ll_sched_insert(sch, 0, preempt_any);
759+
rc = ble_ll_sched_insert(sch, 0, preempt_any_except_big);
750760
}
751761

752762
OS_EXIT_CRITICAL(sr);

0 commit comments

Comments
 (0)