sys/auto_init: control the wdt thread #21024
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This enables the user to stop the watchdog thread at any time, the use case I had is that due to a power glitch the board hangs before reaching main, so the idea was to add the module auto_init_wdt_thread to enable early resets in case the board hangs (workaround ^^) But I don't want the thread to continue working becasue it can interfere with the behavior of the software and can lead to unwanted resets, therefore I wanted to add a "wdt_stop_thread" to stop the watchdog thread once main is reached.
Testing procedure
For testing, I have used the gnrc_networking example and I added the module auto init wdt:
and in main I added:
wdt_thread_stop();
output, no wdt thread: