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-10-11
- Revision:
- 217:d5a2ff093319
- Parent:
- 157:0d79678ed00f
- Child:
- 262:696cd48bb04a
File content as of revision 217:d5a2ff093319:
/******************************************************************************
*
* File: TimerControl.h
* Desciption: ICE Timer Control Class
*
*****************************************************************************/
#ifndef TIMERCONTROL_H
#define TIMERCONTROL_H
#include <string>
#include <stdio.h>
#include <vector>
typedef enum {
TIMER_CONTROL_OK,
TIMER_CONTROL_ERROR,
TIMER_CONTROL_DESTROY
} TimerError_t;
class TimerControl
{
private:
std::string controlFile;
std::string id;
std::string output;
unsigned int priority;
unsigned long startTime;
unsigned int duration;
unsigned long actualStartTime;
enum State {
STATE_OFF,
STATE_RUNNING,
STATE_DISABLED
};
State currentState;
public:
TimerControl() {};
~TimerControl() {
printf("\r%s destructor invoked\n", __func__);
}
// load a control from the control file
bool load(std::string filename);
// start the timer control
void start(void);
// update the timer control (state machine)
TimerError_t update(void);
// start the timer
bool timerStart(void);
// stop the timer
bool timerStop(void);
// start a feed
void startFeed(void);
// stop a feed
void stopFeed(void);
// unregister the control with the output task
void unregisterControl(void);
// display the timer control
void display(void);
std::string getControlFile(void) const {
return controlFile;
}
std::string getId(void) const {
return id;
}
std::string getOutput(void) const {
return output;
}
unsigned int getPriority(void) const {
return priority;
}
unsigned long getStartTime(void) const {
return startTime;
}
unsigned int getDuration(void) const {
return duration;
}
State getCurrentState(void) const {
return currentState;
}
};
#endif
