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@35:6235ef67faa1, 2016-09-09 (annotated)
- Committer:
- jmarkel44
- Date:
- Fri Sep 09 13:33:54 2016 +0000
- Revision:
- 35:6235ef67faa1
- Parent:
- 28:c410a61238bb
- Child:
- 111:d31b3a347e6a
- Child:
- 122:4db48b933115
load() implementation for timer control;
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 | 35:6235ef67faa1 | 21 | string output; |
jmarkel44 | 20:653923c2f37a | 22 | unsigned int dayOfWeek; // days of the week |
jmarkel44 | 20:653923c2f37a | 23 | unsigned int startWeek; // starting week |
jmarkel44 | 20:653923c2f37a | 24 | unsigned int freq; |
jmarkel44 | 35:6235ef67faa1 | 25 | typedef struct tod_tag { |
jmarkel44 | 20:653923c2f37a | 26 | unsigned int start; |
jmarkel44 | 20:653923c2f37a | 27 | unsigned int interval; |
jmarkel44 | 35:6235ef67faa1 | 28 | } Tod_t; |
jmarkel44 | 35:6235ef67faa1 | 29 | Tod_t tod; |
jmarkel44 | 20:653923c2f37a | 30 | |
jmarkel44 | 12:ea87887ca7ad | 31 | public: |
jmarkel44 | 19:9bc8fabeddfa | 32 | TimerControl() {}; |
jmarkel44 | 12:ea87887ca7ad | 33 | ~TimerControl() { |
jmarkel44 | 12:ea87887ca7ad | 34 | printf("\r%s destructor invoked\n", __func__); |
jmarkel44 | 12:ea87887ca7ad | 35 | } |
jmarkel44 | 20:653923c2f37a | 36 | // load a control from the control file |
jmarkel44 | 28:c410a61238bb | 37 | bool load(string filename); |
jmarkel44 | 12:ea87887ca7ad | 38 | string getControlFile(void) { |
jmarkel44 | 12:ea87887ca7ad | 39 | return controlFile; |
jmarkel44 | 12:ea87887ca7ad | 40 | } |
jmarkel44 | 12:ea87887ca7ad | 41 | }; |
jmarkel44 | 12:ea87887ca7ad | 42 | |
jmarkel44 | 12:ea87887ca7ad | 43 | #endif |