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

Francisco notifications at github.com
Fri Mar 29 13:33:03 CET 2019


@kaspar030 @aabadie 

> what are the intended semantics for wdg_init() and wdg_enable()? Does init implicitly enable? I would suggest it shouldn't ...

I would also say it doesn't, we could change it to wdg_setup() and wdg_enable(). That could make it more clear.

>If we change that to wdg_init(uint32_t min_time, uint32_t max_time), the API doesn't need to change when window support gets added to the implementation.

Agree, makes sense.

> can we say something about the time base used for the watchdog? Is it always us, or is it ticks?

By say something do you mean in the header? In the name of the function? Or discussing it here? I think it should be microsecond. Conversion from ticks to us should be done in the respective periph implementation. 

> If we change that to wdg_init(uint32_t min_time, uint32_t max_time), the API doesn't need to change when window support gets added to the implementation.

Agree, will do.

> As the API as is doesn't support multiple wdg devices, can we get away with simple defines? The values should be known at compile time

Yep had already talked off line to @aabadie about doing this.

> That feels ambiguous. Does it reset the wdg device or does it reset the wdg counter? Maybe change to "wdg_kick()" or "wdg_trigger()"?

I understand the confusion. How do you fill about this for the api:

`* wdg_enable(void) ------------------> wdg_start(void)`
`* wdg_disable(void) -----------------> wdg_stop(void)`
`* wdg_reset(void) -------------------> wdg_kick(void)`
`* wdg_init(uint32_t min_time) -------> wdg_setup(uint32_t min_time, uint32_t max_time)`







-- 
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#issuecomment-477981365
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190329/713e0c6c/attachment.html>


More information about the notifications mailing list