wdt - watchdog Operation Library#

Adapted Air780E/Air700E Air780EP Air601 Air101/Air103 Air105 ESP32C3 ESP32S3

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Tip

This library has its own demo,click this link to view the demo example of wdt

wdt.init(timeout)#

Initialize the watchdog and enable it now. Most devices cannot be turned off once watchdog is enabled..

Parameters

Incoming Value Type

Explanation

int

Timeout duration, in milliseconds

Return Value

return value type

explanation

bool

Return true on success, otherwise return false (for example, the underlying does not support)

Examples

wdt.init(9000)
sys.timerLoopStart(wdt.feed, 3000)

wdt.setTimeout(timeout)#

Some devices support resetting the watchdog timeout duration

Parameters

Incoming Value Type

Explanation

int

Timeout duration, in milliseconds

Return Value

return value type

explanation

bool

Return true on success, otherwise return false (for example, the underlying does not support)

Examples

wdt.init(10000)
sys.timerLoopStart(wdt.feed, 3000)
sys.wait(5000)
sys.setTimeout(5000)

wdt.feed()#

Feed the dog, reset the timeout and reset the timer.

Parameters

None

Return Value

return value type

explanation

bool

Return true on success, otherwise return false (for example, the underlying does not support)

Examples

wdt.init(10000)
-- Feed the dog regularly, or on demand according to the business
sys.timerLoopStart(wdt.feed, 3000)

wdt.close()#

Close watchdog, usually not supported

Parameters

None

Return Value

return value type

explanation

bool

Return true on success, otherwise return false (for example, the underlying does not support)

Examples

wdt.init(10000)
sys.wait(9000)
wdt.close()