Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/OutputTask/Control.cpp

Committer:
jmarkel44
Date:
2016-10-06
Revision:
192:052a419837fa
Parent:
185:5ac6ab1ed875
Child:
212:289f63158d2b

File content as of revision 192:052a419837fa:

/******************************************************************************
 *
 * File:                Control.cpp
 * Desciption:          ICE Control Class implementation for Output Thread
 *
 *****************************************************************************/
#include <Control.h>

int Control::getMappedState(void) const
{
    switch (controlType) {
        case CONTROL_TIMER:
        case CONTROL_SETPOINT:
            return (state) ? RELAY_STATUS_AUTO_ON : RELAY_STATUS_AUTO_OFF;
        case CONTROL_MANUAL:
            return (state) ? RELAY_STATUS_MANUAL_ON : RELAY_STATUS_MANUAL_OFF;
        case CONTROL_COMPOSITE:
        case CONTROL_PID:
        default:
            return -1;
    }
}