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
- Committer:
- jmarkel44
- Date:
- 2016-09-23
- Revision:
- 126:c85ac6a8e9af
- Parent:
- 122:4db48b933115
- Child:
- 128:534bf29132f8
File content as of revision 126:c85ac6a8e9af:
/******************************************************************************
*
* File: TimerControl.h
* Desciption: ICE Timer Control Class
*
*****************************************************************************/
#ifndef TIMERCONTROL_H
#define TIMERCONTROL_H
#include <string>
#include <stdio.h>
class TimerControl
{
private:
std::string controlFile;
std::string id;
unsigned int priority;
unsigned int dow;
unsigned int startw;
std::string output;
unsigned int startHour;
unsigned int startMinute;
unsigned int duration;
public:
TimerControl() {};
~TimerControl() {
printf("\r%s destructor invoked\n", __func__);
}
// load a control from the control file
bool load(std::string filename);
void display(void);
std::string getControlFile(void) {
return controlFile;
}
void start(void);
void update(void);
};
#define DAYS_IN_WEEK (7)
#define DAY_SUNDAY_MASK (1 << 0)
#define DAY_MONDAY_MASK (1 << 1)
#define DAY_TUESDAY_MASK (1 << 2)
#define DAY_WEDNESDAY_MASK (1 << 3)
#define DAY_THURSDAY_MASK (1 << 4)
#define DAY_FRIDAY_MASK (1 << 5)
#define DAY_SATURDAY_MASK (1 << 6)
// used to decipher starting week
typedef enum
{
EVERY_WEEK = 0,
FIRST_WEEK = 1,
SECOND_WEEK = 2,
THIRD_WEEK = 3,
FOURTH_WEEK = 4,
LAST_WEEK = 5,
EVERY_OTHER_WEEK = 6
} WEEKLY_CHOICES;
#endif
