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_r367540336
 
 

 ##########
 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;
-                    before = entry;
-                    TAILQ_INSERT_BEFORE(before, sch, link);
-                    break;
-                } else {
-                    sch->start_time = entry->end_time;
-                    sch->end_time = sch->start_time + duration;
 
 Review comment:
   `sch->end_time > next_sch->start_time` is impossible, because `next_sch` is 
the next element after `entry` (see line 968). `entry` is the last element 
overlapping `sch` so `next_sch` cannot overlap `sch`.

----------------------------------------------------------------
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

Reply via email to