Flying Sea Glider / Mbed 2 deprecated 2019_13sep_jcw_nosd

Dependencies:   mbed MODSERIAL FATFileSystem

Revision:
99:9d0849f5fcd7
Parent:
95:1aac4086928a
diff -r 81db9332212d -r 9d0849f5fcd7 ConfigFileIO/ConfigFileIO.cpp
--- a/ConfigFileIO/ConfigFileIO.cpp	Mon May 20 18:57:23 2019 +0000
+++ b/ConfigFileIO/ConfigFileIO.cpp	Fri Jun 28 13:59:11 2019 +0000
@@ -83,12 +83,14 @@
     //SAVE THE DATA!
     xbee().printf("Saving logfile version numbers !");
     
+    
     if (!write_logvers_txt.write("/local/logvers.txt")) {
         xbee().printf("\n\rERROR: (SAVE)Failure to write logvers.txt file.");
     }
     else {
-        xbee().printf("\n\rFile logvvrs.txt successful written.\n\r");
+        xbee().printf("\n\rFile logvers.txt successful written.\n\r");
     }  
+    wait(1);
 }
 
 void ConfigFileIO::savePitchData(float pitch_p_gain, float pitch_i_gain, float pitch_d_gain, float pitch_zeroOffset, float pitch_filter_freq, float pitch_deadband) {   
@@ -497,6 +499,28 @@
     
     return count;     
 }
+
+int ConfigFileIO::load_ALT_config() { // I could copy this mode to read one line of a leg_mission file. One line or multiple lines?
+    ConfigFile cfg;
+    int count = 0;
+    if (!cfg.read("/local/alt.txt")) {   //   "/local/leg_mission.txt"
+            error("ALT File Read Error");
+    }
+    char value[BUFSIZ];
+ 
+    
+    if (cfg.getValue("slope", &value[0] , sizeof(value))) {
+        sensors().setAltimeterSlope(atof(value));  // but I want values in a legStructLoaded, not a function
+        count++;
+    }
+    if (cfg.getValue("intercept", &value[0] ,sizeof(value))) {
+        sensors().setAltimeterIntercept(atof(value));
+        count++;
+    }
+    
+    return count;     
+}
+
 void ConfigFileIO::report_still_inverted( float roll_value, int yotime) {
      ConfigFile still_inverted;