[riot-notifications] [RIOT-OS/RIOT] cpu/nrf5x: implement wdt peripheral driver (#11556)

benpicco notifications at github.com
Fri Sep 13 17:02:24 CEST 2019


benpicco commented on this pull request.



> @@ -87,7 +87,7 @@ void wdt_setup_reboot(uint32_t min_time, uint32_t max_time)
     NRF_WDT->CONFIG |= (NRF_WDT_HALT_MODE << WDT_CONFIG_HALT_Pos);
 
     /* timeout (s) = (CRV + 1) / 32768 */
-    uint32_t crv = (uint32_t)(max_time * 32.768) - 1;
+    uint32_t crv = (uint32_t)((max_time << 15) / 1000) - 1;

Now you don't need that cast anymore.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11556#pullrequestreview-288075578
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190913/eb9d9667/attachment-0001.htm>


More information about the notifications mailing list