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:
- 88:1813f583cee9
- Parent:
- 87:6d95f853dab3
- Child:
- 95:1aac4086928a
diff -r 6d95f853dab3 -r 1813f583cee9 ConfigFileIO/ConfigFileIO.cpp --- 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;