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 2022/02/16 13:39:59 UTC

[mynewt-core] branch master updated: hw/mcu/cmac: Fix calculating time-to-next timer

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-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 7102d0d  hw/mcu/cmac: Fix calculating time-to-next timer
7102d0d is described below

commit 7102d0d86450a090cbb9253392061e3b70682c89
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Jan 28 15:24:24 2022 +0100

    hw/mcu/cmac: Fix calculating time-to-next timer
    
    Need to use proper comparator.
---
 hw/mcu/dialog/cmac/src/cmac_timer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/mcu/dialog/cmac/src/cmac_timer.c b/hw/mcu/dialog/cmac/src/cmac_timer.c
index 0b828f9..72ef956 100644
--- a/hw/mcu/dialog/cmac/src/cmac_timer.c
+++ b/hw/mcu/dialog/cmac/src/cmac_timer.c
@@ -431,9 +431,10 @@ cmac_timer_next_at(void)
         to_next = min(to_next, reg32 - val32);
     }
 
-    if (mask & CMAC_CM_LL_INT_MSK_SET_REG_LL_TIMER1_EQ_Y_SEL_Msk) {
-        reg32 = (CMAC->CM_LL_TIMER1_EQ_Y_HI_REG << 10) |
-                CMAC->CM_LL_TIMER1_EQ_Y_LO_REG;
+    if (mask & (CMAC_CM_LL_INT_MSK_SET_REG_LL_TIMER1_36_10_EQ_Y_SEL_Msk |
+                CMAC_CM_LL_INT_MSK_SET_REG_LL_TIMER1_9_0_EQ_Y_SEL_Msk)) {
+        reg32 = (CMAC->CM_LL_TIMER1_36_10_EQ_Y_REG << 10) |
+                CMAC->CM_LL_TIMER1_9_0_EQ_Y_REG;
         to_next = min(to_next, reg32 - val32);
     }