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 2019/12/09 18:16:05 UTC

[mynewt-nimble] 02/02: nimble/ll: Fix rfclk after extended scan stop

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 8391e2a40df66b29c98bdd071ba55bba045ca7c3
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Dec 5 17:07:39 2019 +0100

    nimble/ll: Fix rfclk after extended scan stop
    
    It's quite possible that when stopping extended scan we also remove some
    AUX scan items form scheduler so we should trigger rfclk to restart on
    proper item.
---
 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 f331314..75d674a 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -1270,7 +1270,6 @@ ble_ll_scan_sm_stop(int chk_disable)
     if (scansm->ext_scanning) {
         ble_ll_scan_clean_cur_aux_data();
         ble_ll_sched_rmv_elem_type(BLE_LL_SCHED_TYPE_AUX_SCAN, ble_ll_scan_sched_remove);
-        scansm->ext_scanning = 0;
     }
 #endif
 
@@ -1304,6 +1303,15 @@ ble_ll_scan_sm_stop(int chk_disable)
         }
         OS_EXIT_CRITICAL(sr);
     }
+
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+    if (scansm->ext_scanning) {
+#ifdef BLE_XCVR_RFCLK
+        ble_ll_sched_rfclk_chk_restart();
+#endif
+        scansm->ext_scanning = 0;
+    }
+#endif
 }
 
 static int