Modified for compatibility with Rev.E. hardware

Fork of AkmSensor by AKM Development Platform

Revision:
46:5938ad2039b0
Parent:
45:6af8fdde0ef3
Child:
48:427bdb7bf31b
--- a/akmsensormanager.cpp	Tue Dec 05 23:27:20 2017 +0000
+++ b/akmsensormanager.cpp	Wed Dec 13 23:35:23 2017 +0000
@@ -285,7 +285,7 @@
     const int16_t VAL_MIN = -2048;       // Corresponds to 0V
     
     // Convert voltage to ID value
-    uint8_t value = (uint8_t)((val - VAL_MIN)/(float)(VAL_MAX - VAL_MIN) * (1 << bits) + 0.5);
+    uint8_t value = (uint8_t)((val - VAL_MIN)/(double)(VAL_MAX - VAL_MIN) * (1 << bits) + 0.5);
     MSG("#ID = %d.\r\n", value);
 
     return value;
@@ -417,7 +417,7 @@
                     }
                 }
             }else if(msg.getArgNum() == 1){
-                float interval = (float)(1.0 / (float)msg.getArgument(0));
+                float interval = (float)(1.0 / (double)msg.getArgument(0));
                 error_code = sensor[sensorIndex]->startSensor(interval);
                 if( error_code != AkmSensor::SUCCESS ){
                     MSG("#Error: StartSensor Error. Code=%d\r\n",error_code);            
@@ -539,7 +539,7 @@
 }
 
 AkmSensorManager::Status AkmSensorManager::throwMessage(const Message *msg) {
-    int len = Message::getMaxMessageLength();
+    const int len = Message::getMaxMessageLength();
     char buf[len];
     
     buf[0] = '$';           // Output message prefix
@@ -588,7 +588,7 @@
 char* AkmSensorManager::getSensorName(){
     char* name = "";
     for(int i=0; i<sensorNum; i++){
-        name = my_strcat(name, sensor[i]->getSensorName());
+        name = my_strcat(name, (char *)sensor[i]->getSensorName());
         if( sensorNum > (i+1) )name = my_strcat(name, "+");
     }
     MSG("#Sensor Name='%s'.\r\n",name);