Numworks Epsilon  1.4.1
Graphing Calculator Operating System
timer.h
Go to the documentation of this file.
1 #ifndef ESCHER_TIMER_H
2 #define ESCHER_TIMER_H
3 
4 #include <stdint.h>
5 
6 /* Timers we'll need
7  * - Blink cursor timer
8  * - Dim Screen timer
9  * - Power down timer
10  * - Watchdog timer ?
11  * - Battery level timer
12  * - LED blink timer
13  */
14 
15 class Timer {
16 public:
17  static constexpr int TickDuration = 300; // In Miliseconds
18  Timer(uint32_t period); // Period is in ticks
19  bool tick();
20  void reset();
21 protected:
22  virtual bool fire() = 0;
23 private:
24  uint32_t m_period;
25  uint32_t m_numberOfTicksBeforeFire;
26 };
27 
28 #endif
static constexpr int TickDuration
Definition: timer.h:17
Definition: timer.h:15
bool tick()
Definition: timer.cpp:9
virtual bool fire()=0
unsigned int uint32_t
Definition: stdint.h:6
Timer(uint32_t period)
Definition: timer.cpp:3
void reset()
Definition: timer.cpp:19