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/ControlTask/ControlTask.cpp
- Committer:
- jmarkel44
- Date:
- 2016-09-13
- Revision:
- 46:4cb96ab2d1c8
- Parent:
- 22:fe535532859c
- Child:
- 48:1c7861d80d16
File content as of revision 46:4cb96ab2d1c8:
#include "ControlTask.h"
#include <stdio.h>
#include "rtos.h"
#include "ConfigurationHandler.h"
#include "MTSLog.h"
static void serviceSetpointControl(SetpointControl *control);
static void serviceTimerControl(TimerControl *control);
/*****************************************************************************
* Function: ControlTask()
* Description: show the controls
*
* @param msg
* @return none
*****************************************************************************/
void ControlTask(void const *args)
{
printf("\r%s has started...\n", __func__);
while ( true ) {
// service the setpoint controls
if ( !setpointTable.empty() ) {
StringSetpointMap::iterator pos;
for ( pos = setpointTable.begin(); pos != setpointTable.end(); ++pos ) {
serviceSetpointControl(pos->second);
}
}
// service the timer controls
if ( !timerTable.empty() ) {
StringTimerMap::iterator pos;
for ( pos = timerTable.begin(); pos != timerTable.end(); ++pos ) {
serviceTimerControl(pos->second);
}
}
Thread::wait(5000);
}
}
/*****************************************************************************
* Function: serviceSetpointControl()
* Description: service a setpoint control
*
* @param control -> the setpoint control object
* @return none
*****************************************************************************/
static void serviceSetpointControl(SetpointControl *control)
{
logInfo("\r%s: servicing control %s\n",
__func__, control->getControlFile().c_str());
}
/*****************************************************************************
* Function: serviceTimerControl()
* Description: service a timer control
*
* @param control -> the timer control object
* @return none
*****************************************************************************/
static void serviceTimerControl(TimerControl *control)
{
logInfo("\r%s: servicing timer control %s\n",
__func__, control->getControlFile().c_str());
}
