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: main.cpp
- Revision:
- 79:3688c3a0d7f4
- Parent:
- 75:92e79d23d29a
- Child:
- 80:4e5d306d695b
diff -r 17abcd1f08bf -r 3688c3a0d7f4 main.cpp --- a/main.cpp Fri Aug 17 16:52:00 2018 +0000 +++ b/main.cpp Tue Oct 23 20:35:16 2018 +0000 @@ -7,6 +7,8 @@ volatile unsigned int bTick = 0; volatile unsigned int timer_counter = 0; +FILE *_sd_fp; //new 10/23/18 + static unsigned int read_ticker(void) { //Basically this makes sure you're reading the data at one instance (not while it's changing) unsigned int val = bTick; if( val ) @@ -48,7 +50,7 @@ if(current_state != 0) { if (!file_opened) { //if the log file is not open, open it mbedLogger().appendLogFile(current_state, 0); //open MBED file once - //sdLogger().appendLogFile(current_state, 0); //open SD file once + sdLogger().appendLogFile(current_state, 0); //open SD file once file_opened = true; //stops it from continuing to open it @@ -58,7 +60,7 @@ //record to Mbed file system mbedLogger().appendLogFile(current_state, 1); //writing data - //sdLogger().appendLogFile(current_state, 1); //writing data + sdLogger().appendLogFile(current_state, 1); //writing data } //when the current FSM state is zero (SIT_IDLE), close the file @@ -67,9 +69,10 @@ if (file_opened) { //WRITE ONCE mbedLogger().appendLogFile(current_state, 1); //write the idle state, then close + sdLogger().appendLogFile(current_state, 1); //write the idle state, then close mbedLogger().appendLogFile(current_state, 0); //close log file - //sdLogger().appendLogFile(current_state, 0); //close log file + sdLogger().appendLogFile(current_state, 0); //close log file file_opened = false; @@ -146,8 +149,8 @@ // construct the MBED local file system local(); - // construct the SD card file system - //sd_card(); + // construct the SD card file system TEST 10/23/18 + sd_card(); // load config data from files configFileIO().load_BCE_config(); // load the buoyancy engine parameters from the file "bce.txt" @@ -210,7 +213,7 @@ //create log files if not present on file system mbedLogger().initializeLogFile(); - //sdLogger().initializeLogFile(); + sdLogger().initializeLogFile(); // works 10/23/18 setup_complete = true; }