Frederico Prado / smartRamalEZR

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 02 22:57:47 2015 +0000
Revision:
8:e8d86c66283c
Parent:
5:1bc98277c257
Child:
9:e501499af4ef
Implementa??o inicial de c?lculo de tens?o RMS da carga e linha. Novo comando para obter as tens?es de carga e linha.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tpadovani 5:1bc98277c257 1 #include "appCommands.h"
tpadovani 5:1bc98277c257 2 #include "sensor.h"
tpadovani 5:1bc98277c257 3
tpadovani 5:1bc98277c257 4 #define CORTAR_SUCESSO 0
tpadovani 5:1bc98277c257 5 #define CORTAR_NAO_CONFIRMADO 1
tpadovani 5:1bc98277c257 6
tpadovani 5:1bc98277c257 7 extern DigitalOut reset_relay;
tpadovani 5:1bc98277c257 8
tpadovani 5:1bc98277c257 9 void cmdCortar(){
tpadovani 5:1bc98277c257 10 reset_relay = RELE_ON;
tpadovani 5:1bc98277c257 11 wait_ms(APP_PARAMETERS.CORTAR_LARGURA_PULSO_MS);
tpadovani 5:1bc98277c257 12 reset_relay = RELE_OFF;
tpadovani 5:1bc98277c257 13 atualizaEstadoRele(ESTADO_RELE_ABERTO);
tpadovani 5:1bc98277c257 14 wait_ms(APP_PARAMETERS.DELAY_SENSOR_MS);
tpadovani 8:e8d86c66283c 15 if(getEstadoSensor(0) == SENSOR_COM_FORNECIMENTO){
tpadovani 5:1bc98277c257 16 exec.enviaResposta(RESP_CORTAR, CORTAR_NAO_CONFIRMADO);
tpadovani 5:1bc98277c257 17 } else{
tpadovani 5:1bc98277c257 18 exec.enviaResposta(RESP_CORTAR, CORTAR_SUCESSO);
tpadovani 5:1bc98277c257 19 }
tpadovani 5:1bc98277c257 20 }