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

Revision:
37:357e98a929cc
Parent:
36:966a86937e17
Child:
38:83d06c294807
--- a/StateMachine/StateMachine.cpp	Wed Dec 20 23:21:15 2017 +0000
+++ b/StateMachine/StateMachine.cpp	Thu Dec 21 16:07:47 2017 +0000
@@ -2,7 +2,7 @@
 #include "StaticDefs.hpp"
  
 StateMachine::StateMachine() {
-    _timeout = 20;            // generic timeout for every state, seconds
+    _timeout = 120;            // generic timeout for every state, seconds
     
     _pitchTolerance = 5.0;     // pitch angle tolerance for FLOAT_LEVEL state
  
@@ -997,7 +997,8 @@
     // check keyboard and make settings changes as requested
     // states can be changed only at the start of a sequence (when the system is in SIT_IDLE)
     
-    int _keyboard_state = -1;   //made this a local variable because it was retaining the last keyboard state
+    //TEST
+    int _keyboard_state = 0;   //made this a local variable because it was retaining the last keyboard state
     
     if (pc().readable() && (_state == SIT_IDLE || _state == KEYBOARD)) {        
         // get the key
@@ -1216,6 +1217,7 @@
         
         //when you read the keyboard successfully, change the state
         _state = _keyboard_state;   //set state at the end of this function
+        pc().printf("\n\n\r ********* KEYBOARD STATE: %d *********\n\n\r", _state);
     }
 }
  
@@ -1633,7 +1635,7 @@
         _log_timer = timer.read() + 1; //record the time when this block is first entered and add 5 seconds 
         _is_log_timer_running = true;    //disable this block after one iteration
         
-        _data_log[0] = timer.read();                //timer reading (shouldn't this be constant throughout the state?)
+        _data_log[0] = systemTime().read();         //system time reading
         _data_log[1] = depthLoop().getCommand();    //depth command
         _data_log[2] = depthLoop().getPosition();   //depth reading
         _data_log[3] = pitchLoop().getCommand();    //pitch command