EZR

Dependencies:   CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04

Fork of smartRamalKW by Equipe Firmware V2COM

cmd/mmTensao.cpp

Committer:
tpadovani
Date:
2015-07-23
Revision:
10:7a1d1abb5172
Child:
11:8c93e0de58cd

File content as of revision 10:7a1d1abb5172:

#include "appCommands.h"
#include "sensor.h"
#include "memoriaMassa.h"

#define MM_TENSAO_FALHA  1

extern MemoriaMassa mm;

void cmdMMTensao(unsigned char lineOrLoad){
    int channel;
    if(lineOrLoad == APP_PARAMETERS.LOAD_CHANNEL){
        channel = 0;
    } else{
        channel = 1;
    }

    char* resp = mm.getMM(channel);
    if(resp == NULL){
        exec.enviaResposta(RESP_MM_TENSAO, MM_TENSAO_FALHA);
    } else{
        exec.enviaResposta(RESP_MM_TENSAO, resp, 8*APP_PARAMETERS.MM_SIZE);
    }
    free(resp);
}