You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/12/10 17:57:46 UTC

[GitHub] [mynewt-core] wes3 commented on a change in pull request #2126: hw/mcu/nordic: Fix hal_timer firing too early

wes3 commented on a change in pull request #2126: hw/mcu/nordic: Fix hal_timer firing too early
URL: https://github.com/apache/mynewt-core/pull/2126#discussion_r356189913
 
 

 ##########
 File path: hw/mcu/nordic/nrf52xxx/src/hal_timer.c
 ##########
 @@ -168,11 +168,15 @@ nrf_timer_set_ocmp(struct nrf52_hal_timer *bsptimer, uint32_t expiry)
          * The nrf documentation states that you must set the output
          * compare to 2 greater than the counter to guarantee an interrupt.
          * Since the counter can tick once while we check, we make sure
-         * it is greater than 2.
+         * it is greater than 2. Otherwise enable TICK event so we can get an
+         * interrupt at proper tick (also we may get an extra interrupt, but
+         * we will just not handle any timer there).
          */
         if (delta_t < 3) {
 
 Review comment:
   so if I am understanding this correctly, this code will keep interrupting with the tick timer until we reach the expiration time. Given that is the case, I am wondering if we should fire off the timer if delta_t is zero. Otherwise we could end up being a tick late (at least that seems possible).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services