You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/10/01 22:17:48 UTC

[GitHub] [mynewt-nimble] wes3 commented on a change in pull request #1041: nimble/ll: Refactor item scheduling

wes3 commented on a change in pull request #1041:
URL: https://github.com/apache/mynewt-nimble/pull/1041#discussion_r720517162



##########
File path: nimble/controller/src/ble_ll_sched.c
##########
@@ -62,12 +62,200 @@ int32_t g_ble_ll_sched_max_early;
  */
 
 /* Queue for timers */
-TAILQ_HEAD(ll_sched_qhead, ble_ll_sched_item) g_ble_ll_sched_q;
+static TAILQ_HEAD(ll_sched_qhead, ble_ll_sched_item) g_ble_ll_sched_q;
 
 #if MYNEWT_VAL(BLE_LL_STRICT_CONN_SCHEDULING)
 struct ble_ll_sched_obj g_ble_ll_sched_data;
 #endif
 
+static int
+preempt_any(struct ble_ll_sched_item *sch,
+            struct ble_ll_sched_item *item)
+{
+    return 1;
+}
+
+static int
+preempt_none(struct ble_ll_sched_item *sch,
+             struct ble_ll_sched_item *item)
+{
+    return 0;
+}
+
+static int
+preempt_any_except_conn(struct ble_ll_sched_item *sch,
+                        struct ble_ll_sched_item *item)
+{
+    BLE_LL_ASSERT(sch->sched_type == BLE_LL_SCHED_TYPE_CONN);
+
+    if (item->sched_type != BLE_LL_SCHED_TYPE_CONN) {
+        return 1;
+    }
+
+    return ble_ll_conn_is_lru(sch->cb_arg, item->cb_arg);
+}
+
+static inline int
+ble_ll_sched_check_overlap(struct ble_ll_sched_item *sch1,
+                           struct ble_ll_sched_item *sch2)
+{
+    return CPUTIME_GT(sch1->end_time, sch2->start_time) &&
+           CPUTIME_GT(sch2->end_time, sch1->start_time);

Review comment:
       I thought I commented on this but it seems it went away. I am pretty sure this is intentional but it might be worth noting in a function header comment that and item is not considered to overlap if one item ends and another starts at the same time.




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

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org