User Tools

Site Tools


en-us_commands:reference:wdt_disable

This is an old revision of the document!


WDT_DISABLE()

WDT_DISABLE() stops the Watchdog.

WDT_DISABLE command operation flow

void WDT_DISABLE()

Commands

Command Arguments Return Value Operation
WDT_DISABLE() None void Stops the Watchdog.

Example

void setup() {
#if defined(__AVR_ATmega2560__)
  WDT_ENABLE(WDT_2S);  // Set the watchdog timeout and start operation.
#elif defined(__AVR_ATmega128__)
  WDT_ENABLE(WDT_1800MS);  // Set the watchdog timeout and start operation.
#endif
}
 
void loop() {
  const bool maintenanceMode = IdigitalRead(0, 5);  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state.
  if (maintenanceMode) {
    WDT_DISABLE();  // Stop the watchdog.
    return;
  }
  WDT();  // Refresh the watchdog before its timeout expires.
}

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_disable.1788791736.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki