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

ESP32S2: Fix watchdog deinit #4325

Merged
merged 1 commit into from
Mar 4, 2021
Merged

ESP32S2: Fix watchdog deinit #4325

merged 1 commit into from
Mar 4, 2021

Conversation

microdev1
Copy link
Collaborator

Delete subscribed task before watchdog deinit. Fixes #4324.

@microdev1 microdev1 added the espressif applies to multiple Espressif chips label Mar 4, 2021
@tylercrumpton
Copy link

Tested this with my sample watchdog deinit() script, and it all looks good here! The script:

from watchdog import WatchDogMode, WatchDogTimeout
from microcontroller import watchdog as w

print("Initial mode:", w.mode)
w.timeout = 10  # Set a timeout of 10 seconds
w.mode = WatchDogMode.RESET
w.feed()
print("Watchdog running mode:", w.mode)
w.deinit()
print("After deinit mode:", w.mode)

while True:
    try:
        while True:
            pass
    except WatchDogTimeout:
        print("The watchdog got hungry!")

And the output:

Initial mode: None
Watchdog running mode: watchdog.WatchDogMode.RESET
After deinit mode: None

The watchdog successfully stops and allows me to start it again!

Thanks for the fix!

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix, and @tylercrumpton, thanks for testing!

@dhalbert
Copy link
Collaborator

dhalbert commented Mar 4, 2021

Ignoring single failure due to build cache.

@dhalbert dhalbert merged commit 2ae8a44 into adafruit:main Mar 4, 2021
@microdev1 microdev1 deleted the fix-wdt branch March 5, 2021 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESP32-S2 watchdog.deinit() doesn't succeed or raise an error
3 participants