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:02 UTC

[mynewt-nimble] 01/04: nimble/ll: Fix return values from scheduler callbacks

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 b67d108e943b6359512338d8f8bd12366dd006b2
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Oct 4 14:01:44 2021 +0200

    nimble/ll: Fix return values from scheduler callbacks
    
    Make sure we use 'running' and 'done' properly. This did not matter so
    far since return value from sched_cb is not used anywhere, but this is
    going to change.
---
 nimble/controller/src/ble_ll_dtm.c      | 5 +++--
 nimble/controller/src/ble_ll_scan_aux.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/nimble/controller/src/ble_ll_dtm.c b/nimble/controller/src/ble_ll_dtm.c
index de3b168..8c91677 100644
--- a/nimble/controller/src/ble_ll_dtm.c
+++ b/nimble/controller/src/ble_ll_dtm.c
@@ -261,7 +261,7 @@ ble_ll_dtm_tx_sched_cb(struct ble_ll_sched_item *sch)
 
     ble_ll_state_set(BLE_LL_STATE_DTM);
 
-    return BLE_LL_SCHED_STATE_DONE;
+    return BLE_LL_SCHED_STATE_RUNNING;
 
 resched:
     /* Reschedule from LL task if late for this PDU */
@@ -427,9 +427,10 @@ ble_ll_dtm_rx_sched_cb(struct ble_ll_sched_item *sch)
     if (ble_ll_dtm_rx_start() != 0) {
         ble_npl_eventq_put(&g_ble_ll_data.ll_evq, &g_ble_ll_dtm_ctx.evt);
         STATS_INC(ble_ll_dtm_stats, rx_failed);
+        return BLE_LL_SCHED_STATE_DONE;
     }
 
-    return BLE_LL_SCHED_STATE_DONE;
+    return BLE_LL_SCHED_STATE_RUNNING;
 }
 
 static int
diff --git a/nimble/controller/src/ble_ll_scan_aux.c b/nimble/controller/src/ble_ll_scan_aux.c
index 94f776d..a521679 100644
--- a/nimble/controller/src/ble_ll_scan_aux.c
+++ b/nimble/controller/src/ble_ll_scan_aux.c
@@ -163,7 +163,7 @@ ble_ll_scan_aux_sched_cb(struct ble_ll_sched_item *sch)
 
     ble_ll_state_set(BLE_LL_STATE_SCAN_AUX);
 
-    return BLE_LL_SCHED_STATE_DONE;
+    return BLE_LL_SCHED_STATE_RUNNING;
 }
 
 static struct ble_ll_scan_aux_data *