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: MbedLogger/MbedLogger.cpp
- Revision:
- 47:fb3c7929d3f3
- Parent:
- 46:030be9f5c793
- Child:
- 48:20e681885161
--- a/MbedLogger/MbedLogger.cpp Thu Feb 15 02:40:30 2018 +0000 +++ b/MbedLogger/MbedLogger.cpp Thu Feb 15 03:07:16 2018 +0000 @@ -28,7 +28,7 @@ //this function has to be called for the time to function correctly void MbedLogger::setLogTime() { - pc().printf("\nMbed Log time set.\n\r"); + pc().printf("\n%s log time set.\n\r", _file_system_string.c_str()); set_time(1518467832); // Set RTC time to Mon, 12 FEB 2018 15:37 } @@ -39,6 +39,7 @@ return seconds; } +//idea to copy SD file on system down-time void MbedLogger::copySDFile() { } @@ -62,12 +63,6 @@ pc().printf("SD CARD FILE IS %s\n\r", _SD_file_name_string.c_str()); } - -void MbedLogger::saveDataToFile(int input_state, float *input) { - //write to the file (header and data) - fprintf(_fp, "%d,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f,%0.1f\n",input_state,input[0],input[1],input[2],input[3],input[4],input[5],input[6],input[7],input[8],input[9],input[10]); -} - void MbedLogger::recordData(int current_state) { int data_log_int = mbedLogger().getSystemTime(); //read the system timer to get unix timestamp //_data_log[0] = mbedLogger().getSystemTime(); //read the system timer to get unix timestamp @@ -865,6 +860,7 @@ } } +// initialize and close the file void MbedLogger::initializeLogFile() { string file_name_string = _file_system_string + "LOG000.csv";