Bluetooth: Controller: Fix reset of drift_skip count

Fix reset of drift_skip count when an anchor point sync was
missed so that drift compensation is applied on the next
successful anchor point sync. This will improve connection
stability for short overlapping radio event intervals.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2025-01-17 14:50:35 +01:00 committed by Benjamin Cabé
parent 6d35071227
commit e09d629024

View file

@ -1074,7 +1074,7 @@ void ull_conn_done(struct node_rx_event_done *done)
if (done->extra.trx_cnt) {
if (0) {
#if defined(CONFIG_BT_PERIPHERAL)
} else if (lll->role) {
} else if (lll->role == BT_HCI_ROLE_PERIPHERAL) {
if (!conn->periph.drift_skip) {
ull_drift_ticks_get(done, &ticks_drift_plus,
&ticks_drift_minus);
@ -1103,6 +1103,12 @@ void ull_conn_done(struct node_rx_event_done *done)
/* Reset connection failed to establish countdown */
conn->connect_expire = 0U;
} else {
#if defined(CONFIG_BT_PERIPHERAL)
if (lll->role == BT_HCI_ROLE_PERIPHERAL) {
conn->periph.drift_skip = 0U;
}
#endif /* CONFIG_BT_PERIPHERAL */
}
elapsed_event = latency_event + lll->lazy_prepare + 1U;