[riot-notifications] [RIOT-OS/RIOT] drivers/include: add header definition for wdt (#11527)

benpicco notifications at github.com
Thu May 16 11:18:46 CEST 2019

benpicco commented on this pull request.

> +void wdt_setup_reboot(uint32_t min_time, uint32_t max_time);
+ * @brief    Set up the wdt timer, only use max_time if normal operation
+ *           set min_time and max_time for windowed timer.
+ *
+ * @param[in] min_time       lower bound for windowed watchdog in ms, has to be 0
+ *                           for normal mode operation
+ * @param[in] max_time       upper bound for windowed watchdog in ms, time before
+ *                           reset for normal watchdog
+ * @param[in] wdt_cb         wdt callback, can be NULL
+ * @param[in] arg            optional argument which is passed to the
+ *                           callback, can be NULL
+ */
+void wdt_setup_callback(uint32_t min_time, uint32_t max_time, wdt_cb_t wdt_cb, void* arg);

I think this can be misleading: The watchdog will still trigger a reboot and behave just like with `wdt_setup_reboot`, the only difference being that `wdt_cb` is executed before the watchdog timer expires.

Having two functions for it make it seem like `wdt_setup_callback` would cause the callback to be called *instead* of the reboot, not in addition to it.

Imho one `wdt_setup(uint32_t min_time, uint32_t max_time, wdt_cb_t wdt_cb, void* arg)` should be enough. `wdt_cb` can be `NULL` if it's not needed.

Also it would be good if the function can return an error code if an invalid configuration is requested.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190516/1dc433a1/attachment-0001.html>

More information about the notifications mailing list