Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmhallswitch.cpp
- Revision:
- 27:41aa9fb23a2f
- Parent:
- 16:d85be9bafb80
- Child:
- 29:b488d2c89fba
--- a/akmhallswitch.cpp Wed Feb 22 21:56:05 2017 +0000 +++ b/akmhallswitch.cpp Sat Mar 11 01:14:15 2017 +0000 @@ -8,13 +8,11 @@ * Constructor. * */ -AkmHallSwitch::AkmHallSwitch(){ - event = false; +AkmHallSwitch::AkmHallSwitch() : AkmSensor(){ sw0 = NULL; sw1 = NULL; d0 = DigitalIn(DIGITAL_D0); d1 = DigitalIn(DIGITAL_D1); - sensorName = ""; } /** @@ -35,7 +33,6 @@ primaryId = id; subId = subid; - if(primaryId == AKM_PRIMARY_ID_UNIPOLAR && subId == AkmHallSwitch::SUB_ID_EM1771) sensorName = "EM-1771"; else if(primaryId == AKM_PRIMARY_ID_UNIPOLAR && subId == AkmHallSwitch::SUB_ID_EW453) sensorName = "EW-453"; else if(primaryId == AKM_PRIMARY_ID_UNIPOLAR && subId == AkmHallSwitch::SUB_ID_EW652B) sensorName = "EW-652B"; @@ -85,10 +82,6 @@ event = true; } -bool AkmHallSwitch::isEvent(){ - return event; -} - AkmSensor::Status AkmHallSwitch::startSensor(){ sw1->rise(callback(this, &AkmHallSwitch::riseEventD1)); sw1->fall(callback(this, &AkmHallSwitch::fallEventD1)); @@ -127,6 +120,3 @@ AkmSensor::Status AkmHallSwitch::requestCommand(Message* in, Message* out){ return AkmSensor::ERROR; } -char* AkmHallSwitch::getSensorName(){ - return sensorName; -}