EZR

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

Fork of smartRamalKW by Equipe Firmware V2COM

Committer:
tpadovani
Date:
Thu Jul 23 22:46:18 2015 +0000
Revision:
10:7a1d1abb5172
Child:
11:8c93e0de58cd
Mem?ria de massa de tens?o e comando para ler o rel?gio atual.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tpadovani 10:7a1d1abb5172 1 #include "appCommands.h"
tpadovani 10:7a1d1abb5172 2 #include "sensor.h"
tpadovani 10:7a1d1abb5172 3 #include "memoriaMassa.h"
tpadovani 10:7a1d1abb5172 4
tpadovani 10:7a1d1abb5172 5 #define MM_TENSAO_FALHA 1
tpadovani 10:7a1d1abb5172 6
tpadovani 10:7a1d1abb5172 7 extern MemoriaMassa mm;
tpadovani 10:7a1d1abb5172 8
tpadovani 10:7a1d1abb5172 9 void cmdMMTensao(unsigned char lineOrLoad){
tpadovani 10:7a1d1abb5172 10 int channel;
tpadovani 10:7a1d1abb5172 11 if(lineOrLoad == APP_PARAMETERS.LOAD_CHANNEL){
tpadovani 10:7a1d1abb5172 12 channel = 0;
tpadovani 10:7a1d1abb5172 13 } else{
tpadovani 10:7a1d1abb5172 14 channel = 1;
tpadovani 10:7a1d1abb5172 15 }
tpadovani 10:7a1d1abb5172 16
tpadovani 10:7a1d1abb5172 17 char* resp = mm.getMM(channel);
tpadovani 10:7a1d1abb5172 18 if(resp == NULL){
tpadovani 10:7a1d1abb5172 19 exec.enviaResposta(RESP_MM_TENSAO, MM_TENSAO_FALHA);
tpadovani 10:7a1d1abb5172 20 } else{
tpadovani 10:7a1d1abb5172 21 exec.enviaResposta(RESP_MM_TENSAO, resp, 8*APP_PARAMETERS.MM_SIZE);
tpadovani 10:7a1d1abb5172 22 }
tpadovani 10:7a1d1abb5172 23 free(resp);
tpadovani 10:7a1d1abb5172 24 }