Robert Ellis / TaskManager
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Task.cpp Source File

Task.cpp

00001 
00002 #include "Task.h"
00003 
00004 Task::Task()
00005 {
00006     interval = DEFAULT_INTERVAL;
00007 }
00008 
00009 Task::Task(int _interval)
00010 {
00011     interval = _interval;
00012 }
00013 
00014 void Task::start()
00015 {
00016     ticker.attach_us(this, &Task::preTick, interval);
00017     running = true;
00018 }
00019 
00020 
00021 void Task::preTick()
00022 {
00023     this->tick();
00024 }
00025 
00026 void Task::stop()
00027 {
00028     ticker.detach();
00029     running = false;
00030 }
00031