Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is ambiguous #39

Open
AmrSaber opened this issue May 22, 2020 · 1 comment
Open

Documentation is ambiguous #39

AmrSaber opened this issue May 22, 2020 · 1 comment

Comments

@AmrSaber
Copy link

The documentation is not obvious, I mean I know what watchdog timer is and how it should work and all, but the API reference is not clear.

I can't understand what event gets called when, and what does each function do (feed function has the documentation that it feeds the dog!).

I don't even know how this maps to the watchdog timer standard where there is a reset (or a kick), that resets the timer, and a callback that gets invoked if time passes (timeout) and no reset was invoked.

If you could please make things more clear, I (and probably other people) would be grateful.

@aalku
Copy link

aalku commented Aug 14, 2024

I think I got to understand it but not the text nor the example were clear enough, I had to read the internal code and test it.

First of all I didn't understand the very "main" verbs about the watchdog:

  1. "Reset" means the watchdog "alarms". In a typical use case if the watchdog "resets" you would need to reset something because it was frozen or failing.
  2. "Feed" means you delay the "reset" event. It means the system is working fine.
  3. "Sleep" means you pause the need for "food". It will be activated again (I think) when the watchdog is "fed".

Then I needed to understand how they actually work in detail:

  1. A new watchdog won't reset unless it's "feeded" for the first time. It's the first feed that starts the timer.
  2. After a reset, if you need the timer to run again you need to "feed" the watchdog. Otherwise it's stopped.
  3. The "food" object is modified internally in a way that will make different watchdogs interact with each other in a way you don't expect (they will copy the default timeout from one to another) so it's important that you create a new food object for each watchdog if you have several of them with different timeouts.

About that last point I think that's a mistake of design and should be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants