You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/01/06 14:08:12 UTC

[mynewt-nimble] branch master updated: nimble/ll: Allow to tune time needed for scheduling next conn event

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

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


The following commit(s) were added to refs/heads/master by this push:
     new b90c5eca nimble/ll: Allow to tune time needed for scheduling next conn event
b90c5eca is described below

commit b90c5ecafb9a06bb683393e37b259efef1f35045
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Wed Dec 21 10:43:18 2022 +0100

    nimble/ll: Allow to tune time needed for scheduling next conn event
    
    This works by allowing to shorten connection event end time by specified
    number of us. This value should be tuned only after measuring performance
    as depends on various factors like build optimisation, cache, clock
    speed etc.
---
 nimble/controller/src/ble_ll_conn.c | 2 ++
 nimble/controller/syscfg.yml        | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 8e327f41..408e9b8a 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -939,6 +939,8 @@ ble_ll_conn_get_next_sched_time(struct ble_ll_conn_sm *connsm)
     rem_us = connsm->anchor_point_usecs;
     ble_ll_tmr_add_u(&ce_end, &rem_us, connsm->conn_itvl_usecs);
 
+    ce_end -= ble_ll_tmr_u2t_up(MYNEWT_VAL(BLE_LL_CONN_EVENT_END_MARGIN));
+
     if (ble_ll_sched_next_time(&next_sched_time)) {
         if (LL_TMR_LT(next_sched_time, ce_end)) {
             ce_end = next_sched_time;
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index 38f63795..3c1dc18b 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -537,6 +537,15 @@ syscfg.defs:
         range: 1..257
         value: 32
 
+    BLE_LL_CONN_EVENT_END_MARGIN:
+        description: >
+            Extra time needed for scheduling next connection event. Setting this
+            value results in ending connection event sooner (in microseconds)
+            which gives more time to schedule next event. This value should be
+            tuned only after measuring performance as depends on various factors
+            like  build optimisation, cache, clock speed etc.
+        value: 0
+
     BLE_LL_STACK_SIZE:
         description: >
               This is the stack size for LL task.