Modified for compatibility with Rev.E. hardware

Fork of AkmSensor by AKM Development Platform

Revision:
47:221ec4b404ec
Parent:
46:5938ad2039b0
diff -r 5938ad2039b0 -r 221ec4b404ec ak09970ctrl.cpp
--- a/ak09970ctrl.cpp	Wed Dec 13 23:35:23 2017 +0000
+++ b/ak09970ctrl.cpp	Thu Dec 14 00:21:43 2017 +0000
@@ -51,7 +51,7 @@
             = { AK09970::SLAVE_ADDR_1,
                 AK09970::SLAVE_ADDR_2};
 
-        for(int i=0; i<sizeof(slaveAddr); i++)
+        for(unsigned int i=0; i<sizeof(slaveAddr); i++)
         {
             ak09970->init(i2c, slaveAddr[i]);
             // Checks connectivity
@@ -150,7 +150,7 @@
     AkmSensor::clearEvent();
         
     AK09970::SwitchStatus sw_status;
-    if( ak09970->getSwitchStatus(&sw_status, readConfig) != AkmSensor::SUCCESS) {
+    if( ak09970->getSwitchStatus(&sw_status, readConfig) != AK09970::SUCCESS) {
         return AkmSensor::ERROR;
     }
     
@@ -183,7 +183,7 @@
             
             AK09970::SensorAxis axis = (AK09970::SensorAxis)in->getArgument(0);
             AK09970::Threshold th;
-            if( ak09970->getThreshold(axis, &th) != AkmSensor::SUCCESS ){
+            if( ak09970->getThreshold(axis, &th) != AK09970::SUCCESS ){
                 return AkmSensor::ERROR;
             }
             out->setArgument(0, axis);
@@ -213,7 +213,7 @@
             th.BRP1 = CONV16I(in->getArgument(3),in->getArgument(4));
             th.BOP2 = CONV16I(in->getArgument(5),in->getArgument(6));
             th.BRP2 = CONV16I(in->getArgument(7),in->getArgument(8));
-            if( ak09970->setThreshold(axis, th) != AkmSensor::SUCCESS ){
+            if( ak09970->setThreshold(axis, th) != AK09970::SUCCESS ){
                 status = AkmSensor::ERROR;
             }
             out->setArgument(0,(char)status);