[riot-notifications] [RIOT-OS/RIOT] cpu/stm32_common: add watchdog for stm32 (#11252)

Francisco notifications at github.com
Mon Mar 25 16:33:14 CET 2019


fjmolinas commented on this pull request.



> +
+    uint8_t pre = _find_prescaler(rst_time);
+    uint16_t rel = _find_reload_value(pre, rst_time);
+
+    /* Set watchdog prescaler and reload value */
+    _set_prescaler(pre);
+    _set_reload(rel);
+
+    /* Calculate the actual reset time in us */
+    uint32_t time_set = _wdg_time(pre, rel);
+    DEBUG("[wdg]: reset time %lu [us]\n", time_set);
+
+    /* Wait for register to be updated */
+    volatile int timeout = 10000;
+    while(IWDG->SR && timeout){
+        timeout--;

I can agree, it was useful when I wanted to verify that the approximation was "ok". Should I remove the function to get the actual programmed time then? Or leave it as ENABLE_DEBUG option?

-- 
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/11252#discussion_r268703534
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190325/fcf5d5d0/attachment.html>


More information about the notifications mailing list