Files
Upsilon/escher/include/escher/timer.h
Émilie Feral a24cea77d0 [ion] Add a time out in get event
Change-Id: I7c54deb46141d921a7c5019fe8afa324f240954a
2017-04-07 11:30:07 +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
void tick();
void reset();
protected:
virtual void fire() = 0;
private:
uint32_t m_period;
uint32_t m_numberOfTicksBeforeFire;
};
#endif