Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
Watchdog.h
Go to the documentation of this file.
1 
22 #ifndef BLINK_H
23 #define BLINK_H
24 
25 template<unsigned int DEADLINE, void (*ALARM)(unsigned long ms)>
26 class Watchdog {
27 public:
28  static void setup()
29  {
30  }
31  static void loop()
32  {
33  unsigned long start = millis();
34  yield();
35  unsigned long ms = millis() - start;
36  if (ms > DEADLINE) ALARM(ms);
37  }
38 };
39 
40 #endif
static void setup()
Definition: Watchdog.h:28
static void loop()
Definition: Watchdog.h:31
void yield(void)
Definition: Scheduler.cpp:153