[riot-notifications] [RIOT-OS/RIOT] drivers/include: add header definition for wdt (#11527)
notifications at github.com
Tue Jul 9 11:24:14 CEST 2019
> wdt_stop() will only be compiled if the application add "periph/wdt" to "USEMODULE". Adding "periph/wdt" to "FEATURES_OPTIONAL" or "FEATURES_REQUIRED" does that implicitly. (If the target board doesn't support the feature, USEMODULE or FEATURES_REQUIRED" will fail at build time, FEATURES_OPTIONAL will just not add periph_wdt to USEMODULE.).
> At that point, an application can use the wdt_* functions. The linker will ensure that unused functions won't enlarge the binary.
I'll try to explain what I meant again. For many platforms`wdt` can't be stopped, once enabled it runs until a system reset, so `wdt_stop()` does nothing. A use case examples is an application where I would want to turn-off the `wdt` before entering sleep mode. If possible that means I can just go to sleep and start it again on wake-up. But if I can't really stop the `wdt` then I must implement something(`rtc alarm`) that will wake-up just before the `wdt` ends, reset it, and the immediately go to sleep. In this case both platforms would be supporting `wdt` but one of them can `stop` it and the other not.
In that case I could do something like:
// somewhere else in the application for platforms with `wdt`
// a callback that will reset the counter, etc...
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...
More information about the notifications