marcsekz / tinyWatchdog

Arduino-style watchdog library for ATTiny414 (and maybe others)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TinyWatchdog

Simple Arduino-style library for handling watchdog timer on ATTiny414 (and similar, probably works for every tinyAVR series-1)

Usage:

Without window function, 128ms timeout:

void setup() {
  Watchdog.begin(watchdogTimeout::timeout128ms);
  Watchdog.enable();
}

void loop() {
  // Other code probably

  Watchdog.reset();
}

With window function, 1024ms timeout, 256ms window:

void setup() {
  Watchdog.begin(watchdogTimeout::timeout128ms);
  Watchdog.enable();
}

void loop() {
  // Other code probably
  delay(500); // Watchdog must not be reset twice within 256ms
  Watchdog.reset();
}

About

Arduino-style watchdog library for ATTiny414 (and maybe others)


Languages

Language:C++ 100.0%