You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2018/11/03 13:21:26 UTC

[mynewt-nimble] branch master updated (525af73 -> bb650cc)

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

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


    from 525af73  porting: do not assing timer ISR prio using RIOT
     new bbfe468  nimble/sched: Add way to remove given type of scheduled element
     new bb650cc  nimble/ll: Remove AUX from scheduler on scanner stop

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../controller/include/controller/ble_ll_sched.h   |  4 ++-
 nimble/controller/src/ble_ll_scan.c                | 10 ++++++-
 nimble/controller/src/ble_ll_sched.c               | 31 ++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)


[mynewt-nimble] 01/02: nimble/sched: Add way to remove given type of scheduled element

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bbfe468774adeb8b702f7e878e8de6306a512ee2
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Wed Oct 24 14:24:52 2018 +0200

    nimble/sched: Add way to remove given type of scheduled element
---
 .../controller/include/controller/ble_ll_sched.h   |  4 ++-
 nimble/controller/src/ble_ll_sched.c               | 31 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/nimble/controller/include/controller/ble_ll_sched.h b/nimble/controller/include/controller/ble_ll_sched.h
index 15f7500..6c7d8a0 100644
--- a/nimble/controller/include/controller/ble_ll_sched.h
+++ b/nimble/controller/include/controller/ble_ll_sched.h
@@ -82,7 +82,7 @@ extern uint8_t g_ble_ll_sched_offset_ticks;
 /* Callback function */
 struct ble_ll_sched_item;
 typedef int (*sched_cb_func)(struct ble_ll_sched_item *sch);
-
+typedef void (*sched_remove_cb_func)(struct ble_ll_sched_item *sch);
 /*
  * Strict connection scheduling (for the master) is different than how
  * connections are normally scheduled. With strict connection scheduling we
@@ -143,6 +143,8 @@ int ble_ll_sched_init(void);
 /* Remove item(s) from schedule */
 void ble_ll_sched_rmv_elem(struct ble_ll_sched_item *sch);
 
+void ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb);
+
 /* Schedule a new master connection */
 struct ble_ll_conn_sm;
 int ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index bb2a7f1..3e341ff 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -1098,6 +1098,37 @@ ble_ll_sched_rmv_elem(struct ble_ll_sched_item *sch)
     OS_EXIT_CRITICAL(sr);
 }
 
+void
+ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb)
+{
+    os_sr_t sr;
+    struct ble_ll_sched_item *entry;
+    struct ble_ll_sched_item *first;
+
+    OS_ENTER_CRITICAL(sr);
+    first = TAILQ_FIRST(&g_ble_ll_sched_q);
+
+    TAILQ_FOREACH(entry, &g_ble_ll_sched_q, link) {
+        if (entry->sched_type == type) {
+            if (first == entry) {
+                os_cputime_timer_stop(&g_ble_ll_sched_timer);
+                first = NULL;
+            }
+
+            TAILQ_REMOVE(&g_ble_ll_sched_q, entry, link);
+            remove_cb(entry);
+            entry->enqueued = 0;
+        }
+    }
+
+    if (!first) {
+        first = TAILQ_FIRST(&g_ble_ll_sched_q);
+        os_cputime_timer_start(&g_ble_ll_sched_timer, first->start_time);
+    }
+
+    OS_EXIT_CRITICAL(sr);
+}
+
 /**
  * Executes a schedule item by calling the schedule callback function.
  *


[mynewt-nimble] 02/02: nimble/ll: Remove AUX from scheduler on scanner stop

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bb650cc692b4c62b21a77dde10e37a56e7fb0875
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Wed Sep 12 13:50:51 2018 +0200

    nimble/ll: Remove AUX from scheduler on scanner stop
---
 nimble/controller/src/ble_ll_scan.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c
index 16fea1e..8b48491 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -1109,7 +1109,13 @@ ble_ll_scan_window_chk(struct ble_ll_scan_sm *scansm, uint32_t cputime)
 
     return 0;
 }
-
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+static void
+ble_ll_scan_sched_remove(struct ble_ll_sched_item *sch)
+{
+    ble_ll_scan_aux_data_free(sch->cb_arg);
+}
+#endif
 /**
  * Stop the scanning state machine
  */
@@ -1132,6 +1138,8 @@ ble_ll_scan_sm_stop(int chk_disable)
     OS_ENTER_CRITICAL(sr);
     ble_ll_scan_clean_cur_aux_data();
     OS_EXIT_CRITICAL(sr);
+
+    ble_ll_sched_rmv_elem_type(BLE_LL_SCHED_TYPE_AUX_SCAN, ble_ll_scan_sched_remove);
 #endif
 
     /* Count # of times stopped */