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 2023/02/27 13:10:31 UTC

[mynewt-nimble] 03/04: nimble/phy/nrf5x: Fix setting RTC CC[0] value

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 154754b577f7fe42b24f699de89c3efa9fb64e36
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Feb 24 23:57:40 2023 +0100

    nimble/phy/nrf5x: Fix setting RTC CC[0] value
    
    CC[0] has only 24 bits valid so we should mask target value. Not really
    sure if this does matter on actual hardware (should not?), but BabbleSim
    does not handle it correctly.
---
 nimble/drivers/nrf5x/src/ble_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/drivers/nrf5x/src/ble_phy.c b/nimble/drivers/nrf5x/src/ble_phy.c
index c1e2df72..bf989e88 100644
--- a/nimble/drivers/nrf5x/src/ble_phy.c
+++ b/nimble/drivers/nrf5x/src/ble_phy.c
@@ -782,7 +782,7 @@ ble_phy_set_start_now(void)
      */
     now = os_cputime_get32();
     NRF_RTC0->EVENTS_COMPARE[0] = 0;
-    nrf_rtc_cc_set(NRF_RTC0, 0, now + 3);
+    nrf_rtc_cc_set(NRF_RTC0, 0, (now + 3) & 0xffffff);
     nrf_rtc_event_enable(NRF_RTC0, RTC_EVTENSET_COMPARE0_Msk);
 
 #if PHY_USE_FEM_LNA