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: StateMachine/StateMachine.cpp
- Revision:
- 35:2f66ea4863d5
- Parent:
- 34:9b66c5188051
- Child:
- 36:966a86937e17
--- a/StateMachine/StateMachine.cpp Wed Dec 20 20:24:15 2017 +0000 +++ b/StateMachine/StateMachine.cpp Wed Dec 20 22:44:02 2017 +0000 @@ -395,7 +395,7 @@ timer.reset(); //stop recording data - mbedLogger().closeFile(); + //mbedLogger().closeFile(); _isTimeoutRunning = false; } @@ -406,7 +406,7 @@ timer.reset(); //stop recording data - mbedLogger().closeFile(); + //mbedLogger().closeFile(); _isTimeoutRunning = false; } @@ -1049,7 +1049,7 @@ else if (userInput == 'P') { //Print current SD card log file printCurrentSdLog(); - mbedLogger().printFromLogFile(); //print the current log file to the screen + //mbedLogger().printFromLogFile(); //print the current log file to the screen } else if (userInput == 'X') { printDirectory(); @@ -1552,22 +1552,25 @@ //error( "MBED directory could not be opened\r\n" ); pc().printf("MBED directory could not be opened\r\n"); } - - pc().printf("\n\rFiles in MBED directory:\n\r"); - for ( int i = 0; i < mbed_dir.size(); i++ ) - pc().printf( "%s\r\n", mbed_dir[ i ].c_str() ); - //SD CARD DIRECTORY + else { + pc().printf("\n\rFiles in MBED directory:\n\r"); + for ( int i = 0; i < mbed_dir.size(); i++ ) + pc().printf( "%s\r\n", mbed_dir[ i ].c_str() ); + } + + //SD CARD DIRECTORY (does not work for openlog) DirectoryList sd_dir( "/sd" ); if ( sd_dir.error_check() ) { //error( "MBED directory could not be opened\r\n" ); - pc().printf("MBED directory could not be opened\r\n"); + pc().printf("SD directory could not be opened\r\n"); } - - pc().printf("\n\rFiles in SD card directory:\n\r"); - for ( int i = 0; i < sd_dir.size(); i++ ) - pc().printf( "%s\r\n", sd_dir[ i ].c_str() ); + else { + pc().printf("\n\rFiles in SD card directory:\n\r"); + for ( int i = 0; i < sd_dir.size(); i++ ) + pc().printf( "%s\r\n", sd_dir[ i ].c_str() ); + } } void StateMachine::printCurrentSdLog() { @@ -1641,7 +1644,7 @@ _data_log[8] = batt().getPosition_mm(); //record data to the MBED every 5 seconds - mbedLogger().saveArrayToFile(string_state,input_state,_data_log); + //mbedLogger().saveArrayToFile(string_state,input_state,_data_log); } if (timer.read() >= _log_timer) { _is_log_timer_running = false; // reset the sub state timer to do one-shot actions again