Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
tasks/periodic_task.cpp
- Committer:
- dwini
- Date:
- 2016-07-11
- Revision:
- 1:4eccf61f4ef7
- Parent:
- periodic_task.cpp@ 0:ba0870ec8714
- Child:
- 3:bd96023168df
File content as of revision 1:4eccf61f4ef7:
#include "periodic_task.h"
namespace SimpleTaskScheduler {
void PeriodicTask::run(void) {
if (state == SHOULD_RUN) {
state = RUNNING;
this->callback.call();
state = WAITING;
}
}
void PeriodicTask::tick(void) {
// Following can mess with your day if your task is long and periodic periodic
//period is small.
state = SHOULD_RUN;
}
};