Skip to content

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