Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 0d75df2eb -> 35eee5b6b


MYNEWT-401: Minor mods to nrf51 and nrf52 hal timer. Remove
an extraneous line of code and fix possible issue with nrf51
16-bit timer.


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/35eee5b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/35eee5b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/35eee5b6

Branch: refs/heads/develop
Commit: 35eee5b6bceae5a98e1a49c99d8f78957fa85bbe
Parents: a852d95
Author: William San Filippo <wi...@runtime.io>
Authored: Fri Oct 21 12:18:18 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Fri Oct 21 12:19:15 2016 -0700

----------------------------------------------------------------------
 hw/mcu/nordic/nrf51xxx/src/hal_timer.c | 4 +---
 hw/mcu/nordic/nrf52xxx/src/hal_timer.c | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/35eee5b6/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c 
b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
index 92e0009..85aedb9 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
@@ -165,7 +165,7 @@ nrf_timer_set_ocmp(struct nrf51_hal_timer *bsptimer, 
uint32_t expiry)
             hwtimer->INTENSET = NRF_TIMER_INT_MASK(NRF_TIMER_CC_INT);
 
             /* Force interrupt to occur as we may have missed it */
-            if (nrf_read_timer_cntr(hwtimer) > expiry16) {
+            if (nrf_read_timer_cntr(hwtimer) >= expiry16) {
                 goto set_ocmp_late;
             }
         } else {
@@ -494,8 +494,6 @@ hal_timer_init(int timer_num, uint32_t freq_hz)
 
     __HAL_ENABLE_INTERRUPTS(ctx);
 
-    hwtimer->PRESCALER = prescaler;
-
     return 0;
 
 err:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/35eee5b6/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c 
b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
index ed15ffb..5aa0864 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
@@ -438,8 +438,6 @@ hal_timer_init(int timer_num, uint32_t freq_hz)
 
     __HAL_ENABLE_INTERRUPTS(ctx);
 
-    hwtimer->PRESCALER = prescaler;
-
     return 0;
 
 err:

Reply via email to