Časovač Watchdog

V čom je problém?

The WDT is used to restart the system when the application crashes and ends up into a non recoverable state. Once started it cannot be stopped or reconfigured in any way. After enabling, the application must “feed” the watchdog periodically to prevent it from expiring and resetting the system.

Vytvorenie časovača

from machine import WDT

wdt = WDT(timeout=8 * 1000)

Maximálna hodnota, ktorú je možné časovaču nastaviť je 8388 ms.

Kŕmenie časovača

wdt.feed()

Ďalšie zdroje

  1. Micropython: class WDT – watchdog timer - Dokumentácia triedy WDT.

  2. MicroPython: WDT (Watchdog timer) - Dokumentácia pre zariadenia rodiny RP2.