Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MODSERIAL FATFileSystem
Diff: ConfigFileIO/ConfigFileIO.cpp
- Revision:
- 99:9d0849f5fcd7
- Parent:
- 95:1aac4086928a
--- 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;