Files
Upsilon/escher/include/escher/timer.h
Émilie Feral c644a8d4f7 [escher] Fix bug: do not redraw window at each timer fire but only for
timer requiring redraw

Change-Id: Ia39a35185a4836809970f5ba77cc76a8b2e6ee26
2017-05-23 15:25:00 +02:00

29 lines
509 B
C++

#ifndef ESCHER_TIMER_H
#define ESCHER_TIMER_H
#include <stdint.h>
/* Timers we'll need
* - Blink cursor timer
* - Dim Screen timer
* - Power down timer
* - Watchdog timer ?
* - Battery level timer
* - LED blink timer
*/
class Timer {
public:
static constexpr int TickDuration = 300; // In Miliseconds
Timer(uint32_t period); // Period is in ticks
bool tick();
void reset();
protected:
virtual bool fire() = 0;
private:
uint32_t m_period;
uint32_t m_numberOfTicksBeforeFire;
};
#endif