User Tools

Site Tools


en-us_commands:reference:wdt_enable

This is an old revision of the document!


WDT_ENABLE()

WDT_ENABLE() sets the Watchdog timeout and starts it.

WDT_ENABLE command operation flow

void WDT_ENABLE(uint8_t ms)

Commands

Command Arguments Return Value Operation
WDT_ENABLE(ms) uint8_t ms void Sets the Watchdog timeout and starts it.

Example

void setup() {
#if defined(__AVR_ATmega2560__)
  WDT_ENABLE(WDT_2S);
#elif defined(__AVR_ATmega128__)
  WDT_ENABLE(WDT_1800MS);
#endif
}

Precautions

  • Use time constants supported by the MCU.
  • Do not set a timeout shorter than the longest normal processing time.
  • Do not hide program faults by placing WDT() where it always executes unconditionally.

← Built-in Command List

en-us_commands/reference/wdt_enable.1788785569.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki