Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/ControlTask/ControlTask.cpp

Committer:
davidjhoward
Date:
2016-09-22
Revision:
116:7337ed514891
Parent:
97:5cf6ab71dcd0
Child:
128:534bf29132f8

File content as of revision 116:7337ed514891:

#include "ControlTask.h"
#include <stdio.h>
#include "rtos.h"
#include "ConfigurationHandler.h"
#include "MTSLog.h"

/*****************************************************************************
 * Function:            ControlTask()
 * Description:         show the controls
 *
 * @param               msg
 * @return              none
 *****************************************************************************/
void ControlTask(void const *args)
{
    bool status;
    
    printf("\r%s has started...\n", __func__);

    while ( true ) {
        
        // service the manual controls
        if ( !manualTable.empty() ) {
            StringManualMap::iterator pos;
            for ( pos = manualTable.begin(); pos != manualTable.end(); ++pos ) {
                pos->second->update();
            }
        }
        // service the setpoint controls
        if ( !setpointTable.empty() ) {
            StringSetpointMap::iterator pos;
            for ( pos = setpointTable.begin(); pos != setpointTable.end(); ++pos ) {
                pos->second->update();
            }
        }
        // service the timer controls
        if ( !timerTable.empty() ) {
            StringTimerMap::iterator pos;
            for ( pos = timerTable.begin(); pos != timerTable.end(); ++pos ) {
                //pos->second->update();
            }
        }
        
        // TODO: service the manual controls 
        Thread::wait(2500);
    }
}