Robert Ellis / TaskManager
Committer:
Phlaphead
Date:
Fri Jan 14 19:51:13 2011 +0000
Revision:
0:e381c3adaa04
Child:
1:e95b703c6ad7

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Phlaphead 0:e381c3adaa04 1
Phlaphead 0:e381c3adaa04 2 #include "Task.h"
Phlaphead 0:e381c3adaa04 3
Phlaphead 0:e381c3adaa04 4 Task::Task()
Phlaphead 0:e381c3adaa04 5 {
Phlaphead 0:e381c3adaa04 6 interval = DEFAULT_INTERVAL;
Phlaphead 0:e381c3adaa04 7 }
Phlaphead 0:e381c3adaa04 8
Phlaphead 0:e381c3adaa04 9 Task::Task(int _interval)
Phlaphead 0:e381c3adaa04 10 {
Phlaphead 0:e381c3adaa04 11 interval = _interval;
Phlaphead 0:e381c3adaa04 12 }
Phlaphead 0:e381c3adaa04 13
Phlaphead 0:e381c3adaa04 14 void Task::start()
Phlaphead 0:e381c3adaa04 15 {
Phlaphead 0:e381c3adaa04 16 ticker.attach_us(this, &Task::preTick, interval);
Phlaphead 0:e381c3adaa04 17 }
Phlaphead 0:e381c3adaa04 18
Phlaphead 0:e381c3adaa04 19
Phlaphead 0:e381c3adaa04 20 void Task::preTick()
Phlaphead 0:e381c3adaa04 21 {
Phlaphead 0:e381c3adaa04 22 this->tick();
Phlaphead 0:e381c3adaa04 23 }