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.
Fork of autonomousRobotAndroid by
Task/Task.cpp@3:92ba0254af87, 2013-03-07 (annotated)
- Committer:
- chrigelburri
- Date:
- Thu Mar 07 09:47:07 2013 +0000
- Revision:
- 3:92ba0254af87
- Parent:
- 0:31f7be68e52d
bitte kommentare korriegieren;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chrigelburri | 3:92ba0254af87 | 1 | #include "Task.h" |
| chrigelburri | 3:92ba0254af87 | 2 | |
| chrigelburri | 3:92ba0254af87 | 3 | Task::Task(float period) |
| chrigelburri | 3:92ba0254af87 | 4 | { |
| chrigelburri | 3:92ba0254af87 | 5 | this->period = period; |
| chrigelburri | 3:92ba0254af87 | 6 | } |
| chrigelburri | 3:92ba0254af87 | 7 | |
| chrigelburri | 3:92ba0254af87 | 8 | Task::~Task() |
| chrigelburri | 3:92ba0254af87 | 9 | { |
| chrigelburri | 3:92ba0254af87 | 10 | |
| chrigelburri | 3:92ba0254af87 | 11 | } |
| chrigelburri | 3:92ba0254af87 | 12 | |
| chrigelburri | 3:92ba0254af87 | 13 | float Task::getPeriod() |
| chrigelburri | 3:92ba0254af87 | 14 | { |
| chrigelburri | 3:92ba0254af87 | 15 | return period; |
| chrigelburri | 3:92ba0254af87 | 16 | } |
| chrigelburri | 3:92ba0254af87 | 17 | |
| chrigelburri | 3:92ba0254af87 | 18 | void Task::start() |
| chrigelburri | 3:92ba0254af87 | 19 | { |
| chrigelburri | 3:92ba0254af87 | 20 | ticker.attach(this, &Task::run, period); |
| chrigelburri | 3:92ba0254af87 | 21 | } |
| chrigelburri | 3:92ba0254af87 | 22 | |
| chrigelburri | 3:92ba0254af87 | 23 | void Task::stop() |
| chrigelburri | 3:92ba0254af87 | 24 | { |
| chrigelburri | 3:92ba0254af87 | 25 | ticker.detach(); |
| chrigelburri | 3:92ba0254af87 | 26 | } |
| chrigelburri | 3:92ba0254af87 | 27 | |
| chrigelburri | 3:92ba0254af87 | 28 | void Task::run() |
| chrigelburri | 3:92ba0254af87 | 29 | { |
| chrigelburri | 3:92ba0254af87 | 30 | |
| chrigelburri | 3:92ba0254af87 | 31 | } |
