most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown
Dependencies: mbed MODSERIAL FATFileSystem
Diff: ConfigFileIO/ConfigFileIO.cpp
- Revision:
- 88:1813f583cee9
- Parent:
- 87:6d95f853dab3
--- a/ConfigFileIO/ConfigFileIO.cpp Wed May 08 13:24:04 2019 +0000 +++ b/ConfigFileIO/ConfigFileIO.cpp Thu May 09 14:26:40 2019 +0000 @@ -548,6 +548,28 @@ xbee().printf("\n\rFile no_float.txt written.\n\r"); } } +void ConfigFileIO::save_FinalTime() { + ConfigFile timefile_txt; + int last_time; + char header[128]; + sprintf(header,"# Timestamp at last moment before closing shop\n"); + + char string_end_time[128]; + last_time = mbedLogger().getSystemTime(); + sprintf(string_end_time, "%d", last_time); + timefile_txt.setValue("TimeStamp", string_end_time); + + + //SAVE THE DATA! + xbee().printf("Saving timestamp value!"); + + if (!timefile_txt.write("/local/newtime.txt")) { + xbee().printf("\n\rERROR: (SAVE)Failure to write time.txt file."); + } +else { + xbee().printf("\n\rFile newtime.txt successfully written.\n\r"); + } +} int ConfigFileIO::load_DEPTH_config() { ConfigFile cfg; int count = 0;