You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2021/11/04 10:36:05 UTC

[mynewt-nimble] 04/04: nimble/ll: Add debugging for sched active item

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 5271e1f95586f479fd546fe5ed3acdc920951c3c
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Nov 2 17:32:20 2021 +0100

    nimble/ll: Add debugging for sched active item
    
    This replaces sched_item_cb debug GPIO with sched_item that is set to
    high state for the entire duration of sched item active time, i.e. from
    sched run to LL standby. Note that sched_item_cb debugging is not that
    useful since it's almost the same as sched_run, so we better replace
    it instead of keeping both to avoid syscfg clutter.
---
 nimble/controller/src/ble_ll.c       | 5 +++++
 nimble/controller/src/ble_ll_sched.c | 9 ++++++---
 nimble/controller/syscfg.yml         | 4 ++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index 014f7e2..1a8e462 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -45,6 +45,7 @@
 #include "controller/ble_ll_trace.h"
 #include "controller/ble_ll_sync.h"
 #include "ble_ll_conn_priv.h"
+#include "ble_ll_priv.h"
 
 #if MYNEWT_VAL(BLE_LL_DTM)
 #include "ble_ll_dtm_priv.h"
@@ -1241,6 +1242,10 @@ void
 ble_ll_state_set(uint8_t ll_state)
 {
     g_ble_ll_data.ll_state = ll_state;
+
+    if (ll_state == BLE_LL_STATE_STANDBY) {
+        BLE_LL_DEBUG_GPIO(SCHED_ITEM, 0);
+    }
 }
 
 /**
diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 5217557..0a9be9c 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -1183,11 +1183,14 @@ ble_ll_sched_execute_item(struct ble_ll_sched_item *sch)
     }
 
 sched:
-    BLE_LL_DEBUG_GPIO(SCHED_ITEM_CB, 1);
     BLE_LL_ASSERT(sch->sched_cb);
 
+    BLE_LL_DEBUG_GPIO(SCHED_ITEM, 1);
     rc = sch->sched_cb(sch);
-    BLE_LL_DEBUG_GPIO(SCHED_ITEM_CB, 0);
+    if (rc != BLE_LL_SCHED_STATE_RUNNING) {
+        BLE_LL_DEBUG_GPIO(SCHED_ITEM, 0);
+    }
+
     return rc;
 }
 
@@ -1331,7 +1334,7 @@ ble_ll_sched_stop(void)
 int
 ble_ll_sched_init(void)
 {
-    BLE_LL_DEBUG_GPIO_INIT(SCHED_ITEM_CB);
+    BLE_LL_DEBUG_GPIO_INIT(SCHED_ITEM);
     BLE_LL_DEBUG_GPIO_INIT(SCHED_RUN);
 
     /*
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index b1fb6b1..13b6780 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -367,10 +367,10 @@ syscfg.defs:
             GPIO pin number to debug scheduler running (on timer). Pin is set
             to high state while scheduler is running.
         value: -1
-    BLE_LL_DEBUG_GPIO_SCHED_ITEM_CB:
+    BLE_LL_DEBUG_GPIO_SCHED_ITEM:
         description: >
             GPIO pin number to debug scheduler item execution times. Pin is set
-            to high state while item is executed.
+            to high state while item is active.
         value: -1
     BLE_LL_DEBUG_GPIO_RFMGMT:
         description: >