Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmakd.cpp
- Revision:
- 48:427bdb7bf31b
- Parent:
- 47:221ec4b404ec
--- a/akmakd.cpp Thu Dec 14 00:21:43 2017 +0000 +++ b/akmakd.cpp Tue Dec 19 12:18:13 2017 -0800 @@ -202,7 +202,11 @@ AkmSensor::Status AkmAkd::startSensor(){ // read one data to clear DRDY AkmECompass::MagneticVectorLsb mag; - compass->getMagneticVectorLsb(&mag); + if( compass->getMagneticVectorLsb(&mag) != AkmECompass::SUCCESS) + { + MSG("#Error: Start sensor failed %s during read LSB.\r\n", sensorName); + return AkmSensor::ERROR; + } AkmAkd::InterruptMode int_mode = getInterrupt(primaryId,subId); if( int_mode == AkmAkd::INTERRUPT_DISABLED ){ @@ -215,7 +219,7 @@ MSG("#Error: Start sensor failed %s\r\n", sensorName); return AkmSensor::ERROR; } - + MSG("#Start sensor %s.\r\n",sensorName); return AkmSensor::SUCCESS; }