You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1016 B
33 lines
1016 B
9 years ago
|
.. _machine.WDT:
|
||
10 years ago
|
|
||
|
class WDT -- watchdog timer
|
||
|
===========================
|
||
|
|
||
|
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
|
||
9 years ago
|
reconfigured in any way. After enabling, the application must "feed" the
|
||
10 years ago
|
watchdog periodically to prevent it from expiring and resetting the system.
|
||
|
|
||
|
Example usage::
|
||
|
|
||
9 years ago
|
wdt = machine.WDT(timeout=2000) # enable with a timeout of 2s
|
||
9 years ago
|
wdt.feed()
|
||
10 years ago
|
|
||
|
Constructors
|
||
|
------------
|
||
|
|
||
9 years ago
|
.. class:: machine.WDT(id=0, timeout=5000)
|
||
10 years ago
|
|
||
9 years ago
|
Create a WDT object and start it. The timeout must be given in seconds and
|
||
|
the minimum value that is accepted is 1 second. Once it is running the timeout
|
||
|
cannot be changed and the WDT cannot be stopped either.
|
||
10 years ago
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
9 years ago
|
.. method:: wdt.feed()
|
||
10 years ago
|
|
||
9 years ago
|
Feed the WDT to prevent it from resetting the system. The application
|
||
10 years ago
|
should place this call in a sensible place ensuring that the WDT is
|
||
9 years ago
|
only fed after verifying that everything is functioning correctly.
|