szafonimateusz-mi commented on code in PR #18117:
URL: https://github.com/apache/nuttx/pull/18117#discussion_r2721606444


##########
arch/arm/src/nrf52/nrf52_tim_lowerhalf.c:
##########
@@ -373,7 +373,7 @@ static int nrf52_timer_settimeout(struct timer_lowerhalf_s 
*lower,
       goto errout;
     }
 
-  cc = (timeout * NRF52_TIMER_PER / 1000000);
+  cc = (timeout * (1000000 / NRF52_TIMER_PER));

Review Comment:
   this is wrong. The correct forumla is `cc = timer_freq * timeout_us / 
1000000`.
   `NRF52_TIMER_PER` name is misleading, it should be `NRF52_TIMER_FREQ`
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to