Repository: incubator-mynewt-core Updated Branches: refs/heads/nrf_cputime 82f7fb15d -> ad64d0c88
Remove some debug code and slight refactor of where BLE_XCVR_RFCLK is defined. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/ad64d0c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/ad64d0c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/ad64d0c8 Branch: refs/heads/nrf_cputime Commit: ad64d0c88adb8aa8ffa0b6a9b18e76d8edd21b08 Parents: 82f7fb1 Author: William San Filippo <[email protected]> Authored: Thu Mar 23 09:08:02 2017 -0700 Committer: William San Filippo <[email protected]> Committed: Thu Mar 23 09:08:02 2017 -0700 ---------------------------------------------------------------------- hw/drivers/nimble/nrf52/include/ble/xcvr.h | 23 ----------------- .../controller/include/controller/ble_ll.h | 26 ++++++++++++++++++++ .../controller/include/controller/ble_phy.h | 4 --- net/nimble/controller/src/ble_ll.c | 9 ------- net/nimble/controller/src/ble_ll_adv.c | 10 -------- net/nimble/host/src/ble_hs_hci_evt.c | 3 --- 6 files changed, 26 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/hw/drivers/nimble/nrf52/include/ble/xcvr.h ---------------------------------------------------------------------- diff --git a/hw/drivers/nimble/nrf52/include/ble/xcvr.h b/hw/drivers/nimble/nrf52/include/ble/xcvr.h index 45d2739..2b6d7ea 100644 --- a/hw/drivers/nimble/nrf52/include/ble/xcvr.h +++ b/hw/drivers/nimble/nrf52/include/ble/xcvr.h @@ -24,30 +24,7 @@ extern "C" { #endif -/* - * WWW: Need to think about this. Does this definition need to be in xcvr.h? - * I guess this should not depend on the 32768 crystal to be honest. This - * should be done for TIMER0 as well since the rf clock chews up more current. - * Deal with this later. - * - * Another note: BLE_XTAL_SETTLE_TIME should be bsp related (I guess). There - * should be a note in there that the converted usecs to ticks value of this - * should not be 0. Thus: if you are using a 32.768 os cputime freq, the min - * value of settle time should be 31 usecs. I would suspect all settling times - * would exceed 31 usecs. - */ - -/* Determines if we need to turn on/off rf clock */ -#undef BLE_XCVR_RFCLK - -/* Transceiver specific definitions */ #if MYNEWT_VAL(OS_CPUTIME_FREQ) == 32768 - -/* We will turn on/off rf clock */ -#if MYNEWT_VAL(BLE_XTAL_SETTLE_TIME) != 0 -#define BLE_XCVR_RFCLK -#endif - /* * NOTE: we have to account for the RTC output compare issue, which is why * this number is much larger when using the 32.768 crystal for cputime. We http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/net/nimble/controller/include/controller/ble_ll.h ---------------------------------------------------------------------- diff --git a/net/nimble/controller/include/controller/ble_ll.h b/net/nimble/controller/include/controller/ble_ll.h index 9319c55..acc201d 100644 --- a/net/nimble/controller/include/controller/ble_ll.h +++ b/net/nimble/controller/include/controller/ble_ll.h @@ -31,6 +31,32 @@ extern "C" { #endif +/* + * XXX: + * I guess this should not depend on the 32768 crystal to be honest. This + * should be done for TIMER0 as well since the rf clock chews up more current. + * Deal with this later. + * + * Another note: BLE_XTAL_SETTLE_TIME should be bsp related (I guess). There + * should be a note in there that the converted usecs to ticks value of this + * should not be 0. Thus: if you are using a 32.768 os cputime freq, the min + * value of settle time should be 31 usecs. I would suspect all settling times + * would exceed 31 usecs. + */ + +/* Determines if we need to turn on/off rf clock */ +#undef BLE_XCVR_RFCLK + +/* Transceiver specific definitions */ +#if MYNEWT_VAL(OS_CPUTIME_FREQ) == 32768 + +/* We will turn on/off rf clock */ +#if MYNEWT_VAL(BLE_XTAL_SETTLE_TIME) != 0 +#define BLE_XCVR_RFCLK +#endif + +#endif + /* Controller revision. */ #define BLE_LL_SUB_VERS_NR (0x0000) http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/net/nimble/controller/include/controller/ble_phy.h ---------------------------------------------------------------------- diff --git a/net/nimble/controller/include/controller/ble_phy.h b/net/nimble/controller/include/controller/ble_phy.h index e2b83e3..2487168 100644 --- a/net/nimble/controller/include/controller/ble_phy.h +++ b/net/nimble/controller/include/controller/ble_phy.h @@ -20,8 +20,6 @@ #ifndef H_BLE_PHY_ #define H_BLE_PHY_ -#include "ble/xcvr.h" - #ifdef __cplusplus extern "C" { #endif @@ -131,13 +129,11 @@ void ble_phy_wfr_enable(uint32_t wfr_usecs); #define ble_phy_stop_usec_timer() #endif -#ifdef BLE_XCVR_RFCLK /* Starts rf clock */ void ble_phy_rfclk_enable(void); /* Stops rf clock */ void ble_phy_rfclk_disable(void); -#endif /* * Used to restart reception on same channel after wfr timer expiration or http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/net/nimble/controller/src/ble_ll.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll.c b/net/nimble/controller/src/ble_ll.c index 1a06d4e..3204ff2 100644 --- a/net/nimble/controller/src/ble_ll.c +++ b/net/nimble/controller/src/ble_ll.c @@ -225,15 +225,6 @@ ble_ll_log(uint8_t id, uint8_t arg8, uint16_t arg16, uint32_t arg32) os_sr_t sr; struct ble_ll_log *le; - /* WWW */ - if ((id >= 90) || (id == 10) || (id == 20)) { - goto good; - } else { - return; - } -good: - /* WWW */ - OS_ENTER_CRITICAL(sr); le = &g_ble_ll_log[g_ble_ll_log_index]; le->cputime = os_cputime_get32(); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/net/nimble/controller/src/ble_ll_adv.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_adv.c b/net/nimble/controller/src/ble_ll_adv.c index b478922..8240d7a 100644 --- a/net/nimble/controller/src/ble_ll_adv.c +++ b/net/nimble/controller/src/ble_ll_adv.c @@ -759,8 +759,6 @@ ble_ll_adv_sm_stop(struct ble_ll_adv_sm *advsm) g_ble_ll_cur_adv_sm = NULL; ble_ll_scan_chk_resume(); #ifdef BLE_XCVR_RFCLK - /* WWW */ - ble_ll_log(201,0,0,0); ble_ll_sched_rfclk_chk_restart(); #endif } @@ -1615,14 +1613,6 @@ ble_ll_adv_done(struct ble_ll_adv_sm *advsm) /* Schedule advertising transmit */ ble_ll_adv_set_sched(advsm); - /* WWW: Need to look at direct advertising (HD) to see if I messed up - * the resched pdu call. - * - * For xcvr clock, we only need to worry when we schedule new adv - * event. We want to make sure we dont turn off the clock if we are - * not done with the advertising event. Think about this. - */ - /* * In the unlikely event we cant reschedule this, just post a done * event and we will reschedule the next advertising event http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ad64d0c8/net/nimble/host/src/ble_hs_hci_evt.c ---------------------------------------------------------------------- diff --git a/net/nimble/host/src/ble_hs_hci_evt.c b/net/nimble/host/src/ble_hs_hci_evt.c index 664df7b..a2084f3 100644 --- a/net/nimble/host/src/ble_hs_hci_evt.c +++ b/net/nimble/host/src/ble_hs_hci_evt.c @@ -622,8 +622,6 @@ ble_hs_hci_evt_acl_process(struct os_mbuf *om) goto err; } - /* WWW*/ -#if 0 #if (BLETEST_THROUGHPUT_TEST == 0) BLE_HS_LOG(DEBUG, "ble_hs_hci_evt_acl_process(): conn_handle=%u pb=%x " "len=%u data=", @@ -633,7 +631,6 @@ ble_hs_hci_evt_acl_process(struct os_mbuf *om) ble_hs_log_mbuf(om); BLE_HS_LOG(DEBUG, "\n"); #endif -#endif /* WWW */ if (hci_hdr.hdh_len != OS_MBUF_PKTHDR(om)->omp_len) { rc = BLE_HS_EBADDATA;
