EZR
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
boxAlarm.cpp
- Committer:
- tpadovani
- Date:
- 2015-10-19
- Revision:
- 22:b66e36356dd4
- Parent:
- 19:1f623070b9dd
File content as of revision 22:b66e36356dd4:
#include "boxAlarm.h" BoxAlarm::BoxAlarm(){ } void BoxAlarm::init(){ boxSensor.mode(PullNone); // if(isAlarmEnabled(ALARME_CAIXA)){ // boxSensor.rise(this, &BoxAlarm::stateChanged); // boxSensor.fall(this, &BoxAlarm::stateChanged); // } } void BoxAlarm::stateChanged(){ bool state = boxSensor; ledBox = state; DEBUG(printf("[BOX ALARM] STATE = %d\r\n", state)); alarm.writeAlarm(ALARME_CAIXA, state, getAlarmState(ALARME_CAIXA)); } void BoxAlarm::checkState(){ bool state = boxSensor; ledBox = state; if(state != getAlarmState(ALARME_CAIXA)){ DEBUG(printf("[BOX ALARM] STATE = %d\r\n", state)); alarm.writeAlarm(ALARME_CAIXA, state, getAlarmState(ALARME_CAIXA)); } }