andrzej-kaczmarek commented on a change in pull request #731: update
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r366734111
##########
File path: nimble/controller/src/ble_ll_sched.c
##########
@@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item
*sch, uint32_t *start,
* with original duration.
*/
before = NULL;
- orig_start = sch->start_time;
+ sch->start_time = orig_start;
entry = start_overlap;
sch->end_time = sch->start_time + duration;
while (1) {
next_sch = entry->link.tqe_next;
if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
- rand_ticks = entry->start_time - sch->end_time;
Review comment:
when checking for overlapping events we had `sch->end_time = orig_end_time +
max_delay_ticks` so for any `entry` in this loop we have `entry->start_time <=
orig_end_time + max_delay_ticks`. this expression translates to `rand_ticks =
entry->start_time - orig_end_time` (because we restored `sch->end_time` to
original value) so by combining the two expressions together we have
`rand_ticks <= max_delay_ticks` which is what we need.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services