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: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
src/ConfigurationHandler/Controls/TimerControl.h@28:c410a61238bb, 2016-09-08 (annotated)
- Committer:
- jmarkel44
- Date:
- Thu Sep 08 20:12:04 2016 +0000
- Revision:
- 28:c410a61238bb
- Parent:
- 20:653923c2f37a
- Child:
- 33:cb765aefa1b5
- Child:
- 35:6235ef67faa1
implement the load function; ;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jmarkel44 | 12:ea87887ca7ad | 1 | /****************************************************************************** |
| jmarkel44 | 12:ea87887ca7ad | 2 | * |
| jmarkel44 | 12:ea87887ca7ad | 3 | * File: TimerControl.h |
| jmarkel44 | 12:ea87887ca7ad | 4 | * Desciption: ICE Timer Control Class |
| jmarkel44 | 12:ea87887ca7ad | 5 | * |
| jmarkel44 | 12:ea87887ca7ad | 6 | *****************************************************************************/ |
| jmarkel44 | 12:ea87887ca7ad | 7 | #ifndef TIMERCONTROL_H |
| jmarkel44 | 12:ea87887ca7ad | 8 | #define TIMERCONTROL_H |
| jmarkel44 | 12:ea87887ca7ad | 9 | |
| jmarkel44 | 12:ea87887ca7ad | 10 | #include <string> |
| jmarkel44 | 12:ea87887ca7ad | 11 | |
| jmarkel44 | 19:9bc8fabeddfa | 12 | using namespace std; |
| jmarkel44 | 19:9bc8fabeddfa | 13 | |
| jmarkel44 | 12:ea87887ca7ad | 14 | class TimerControl |
| jmarkel44 | 12:ea87887ca7ad | 15 | { |
| jmarkel44 | 12:ea87887ca7ad | 16 | private: |
| jmarkel44 | 12:ea87887ca7ad | 17 | string controlFile; // name of the control file |
| jmarkel44 | 20:653923c2f37a | 18 | string id; // identifier |
| jmarkel44 | 20:653923c2f37a | 19 | string name; // friendly name |
| jmarkel44 | 20:653923c2f37a | 20 | unsigned int priority; // control priority |
| jmarkel44 | 20:653923c2f37a | 21 | unsigned int dayOfWeek; // days of the week |
| jmarkel44 | 20:653923c2f37a | 22 | unsigned int startWeek; // starting week |
| jmarkel44 | 20:653923c2f37a | 23 | unsigned int freq; |
| jmarkel44 | 20:653923c2f37a | 24 | struct tod { |
| jmarkel44 | 20:653923c2f37a | 25 | unsigned int start; |
| jmarkel44 | 20:653923c2f37a | 26 | unsigned int interval; |
| jmarkel44 | 20:653923c2f37a | 27 | }; |
| jmarkel44 | 20:653923c2f37a | 28 | |
| jmarkel44 | 12:ea87887ca7ad | 29 | public: |
| jmarkel44 | 19:9bc8fabeddfa | 30 | TimerControl() {}; |
| jmarkel44 | 12:ea87887ca7ad | 31 | ~TimerControl() { |
| jmarkel44 | 12:ea87887ca7ad | 32 | printf("\r%s destructor invoked\n", __func__); |
| jmarkel44 | 12:ea87887ca7ad | 33 | } |
| jmarkel44 | 20:653923c2f37a | 34 | // load a control from the control file |
| jmarkel44 | 28:c410a61238bb | 35 | bool load(string filename); |
| jmarkel44 | 12:ea87887ca7ad | 36 | string getControlFile(void) { |
| jmarkel44 | 12:ea87887ca7ad | 37 | return controlFile; |
| jmarkel44 | 12:ea87887ca7ad | 38 | } |
| jmarkel44 | 12:ea87887ca7ad | 39 | }; |
| jmarkel44 | 12:ea87887ca7ad | 40 | |
| jmarkel44 | 12:ea87887ca7ad | 41 | #endif |
