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:
jmarkel44
Date:
2016-09-26
Revision:
131:a290a3934132
Parent:
128:534bf29132f8
Child:
132:45821e189dd0

File content as of revision 131:a290a3934132:

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

/*****************************************************************************
 * Function:            ControlTask()
 * Description:         This task will loop through all of the configured
 *                      controls
 *
 * @param               msg
 * @return              none
 *****************************************************************************/
void ControlTask(void const *args)
{
    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();
            }
        }
        
        Thread::wait(500);
    }
}