Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
Diff: cmd/cortar.cpp
- Revision:
- 5:1bc98277c257
- Child:
- 8:e8d86c66283c
diff -r 2d0c2643c641 -r 1bc98277c257 cmd/cortar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmd/cortar.cpp Fri Jun 19 21:03:50 2015 +0000 @@ -0,0 +1,20 @@ +#include "appCommands.h" +#include "sensor.h" + +#define CORTAR_SUCESSO 0 +#define CORTAR_NAO_CONFIRMADO 1 + +extern DigitalOut reset_relay; + +void cmdCortar(){ + reset_relay = RELE_ON; + wait_ms(APP_PARAMETERS.CORTAR_LARGURA_PULSO_MS); + reset_relay = RELE_OFF; + atualizaEstadoRele(ESTADO_RELE_ABERTO); + wait_ms(APP_PARAMETERS.DELAY_SENSOR_MS); + if(getEstadoSensor() == SENSOR_COM_FORNECIMENTO){ + exec.enviaResposta(RESP_CORTAR, CORTAR_NAO_CONFIRMADO); + } else{ + exec.enviaResposta(RESP_CORTAR, CORTAR_SUCESSO); + } +}