OpenMV Feature: WDT()
Description
WDT working for the STM32, MIMXRT, and Alif on the machine module.
All watchdog types need to work. For example, on the STM32, only the IWDG is implemented right now; however, this watchdog will reset you during deep sleep. There's another watchdog on the STM32 that turns off when in deep sleep.
Code Size
No response
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
esp32/machine_wdt: Allow feeding WDT from threads.
This changes the ESP32 WDT implementation to use a custom handle so that it becomes possible to reset the WDT from a thread.
By default esp_task_wdt_add subscribes the task_id of the current task. That means that if we're running in a different task we are unable to reset the WDT, which prevents feeding the WDT from a thread directly, or even from a timer (which may randomly run in a different task when there's multiple threads).
As an added bonus, the name we set makes the error clearly specify that it was the user-specified WDT that reset the chip:
>>> import machine
>>> machine.WDT(timeout=1)
<WDT>
>>> E (32600) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (32600) task_wdt: - mpy_machine_wdt