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.
Dependencies: mbed
Task.h@0:c93ca52fb206, 2020-04-01 (annotated)
- Committer:
- gassetim
- Date:
- Wed Apr 01 14:41:51 2020 +0000
- Revision:
- 0:c93ca52fb206
p3
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| gassetim | 0:c93ca52fb206 | 1 | /* |
| gassetim | 0:c93ca52fb206 | 2 | * Task.h |
| gassetim | 0:c93ca52fb206 | 3 | * Copyright (c) 2020, ZHAW |
| gassetim | 0:c93ca52fb206 | 4 | * All rights reserved. |
| gassetim | 0:c93ca52fb206 | 5 | */ |
| gassetim | 0:c93ca52fb206 | 6 | |
| gassetim | 0:c93ca52fb206 | 7 | #ifndef TASK_H_ |
| gassetim | 0:c93ca52fb206 | 8 | #define TASK_H_ |
| gassetim | 0:c93ca52fb206 | 9 | |
| gassetim | 0:c93ca52fb206 | 10 | #include <cstdlib> |
| gassetim | 0:c93ca52fb206 | 11 | |
| gassetim | 0:c93ca52fb206 | 12 | /** |
| gassetim | 0:c93ca52fb206 | 13 | * This is an abstract task class with a method that |
| gassetim | 0:c93ca52fb206 | 14 | * is called periodically by a task sequencer. |
| gassetim | 0:c93ca52fb206 | 15 | */ |
| gassetim | 0:c93ca52fb206 | 16 | class Task { |
| gassetim | 0:c93ca52fb206 | 17 | |
| gassetim | 0:c93ca52fb206 | 18 | public: |
| gassetim | 0:c93ca52fb206 | 19 | |
| gassetim | 0:c93ca52fb206 | 20 | static const int FAULT = -1; /**< Task return value. */ |
| gassetim | 0:c93ca52fb206 | 21 | static const int RUNNING = 0; /**< Task return value. */ |
| gassetim | 0:c93ca52fb206 | 22 | static const int DONE = 1; /**< Task return value. */ |
| gassetim | 0:c93ca52fb206 | 23 | |
| gassetim | 0:c93ca52fb206 | 24 | Task(); |
| gassetim | 0:c93ca52fb206 | 25 | virtual ~Task(); |
| gassetim | 0:c93ca52fb206 | 26 | virtual int run(float period); |
| gassetim | 0:c93ca52fb206 | 27 | }; |
| gassetim | 0:c93ca52fb206 | 28 | |
| gassetim | 0:c93ca52fb206 | 29 | #endif /* TASK_H_ */ |
| gassetim | 0:c93ca52fb206 | 30 |