Numworks Epsilon  1.4.1
Graphing Calculator Operating System
timer.cpp
Go to the documentation of this file.
1 #include <escher/timer.h>
2 
4  m_period(period),
5  m_numberOfTicksBeforeFire(period)
6 {
7 }
8 
9 bool Timer::tick() {
10  m_numberOfTicksBeforeFire--;
11  if (m_numberOfTicksBeforeFire == 0) {
12  bool needRedraw = fire();
13  reset();
14  return needRedraw;
15  }
16  return false;
17 }
18 
19 void Timer::reset() {
20  m_numberOfTicksBeforeFire = m_period;
21 }
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