Skip to content

Commit 14b369e

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Fix to use ticks_drift for duration calculation
Fix Extended Advertising stop on duration by using the ticks_drift which now includes the random delay and any ticker rescheduling of advertising radio events due to collision with other radio events. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 19fe102 commit 14b369e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,15 +2157,11 @@ static void ticker_cb(uint32_t ticks_at_expire, uint32_t ticks_drift,
21572157
uint32_t ticks_interval =
21582158
HAL_TICKER_US_TO_TICKS((uint64_t)adv->interval *
21592159
ADV_INT_UNIT_US);
2160-
uint32_t ticks_elapsed = ticks_interval * (lazy + 1);
2160+
uint32_t ticks_elapsed = ticks_interval * (lazy + 1) +
2161+
ticks_drift;
21612162

21622163
if (adv->ticks_remain_duration > ticks_elapsed) {
21632164
adv->ticks_remain_duration -= ticks_elapsed;
2164-
2165-
if (adv->ticks_remain_duration > random_delay) {
2166-
adv->ticks_remain_duration -=
2167-
random_delay;
2168-
}
21692165
} else {
21702166
adv->ticks_remain_duration = ticks_interval;
21712167
}

0 commit comments

Comments
 (0)