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:
92:52a91656458a
Parent:
88:1813f583cee9
--- a/main.cpp	Thu May 09 14:57:45 2019 +0000
+++ b/main.cpp	Mon May 13 19:25:26 2019 +0000
@@ -426,7 +426,8 @@
                 if ( (tNow % 2000) == 0 ) {   // 2 second intervals
                     
                     led3()=1; 
-                    sprintf(buf, "hit 2 second  log interval in main loop current_state=%d tNow =%d  imu.roll = %f not-unsampled \n\n\r", current_state, tNow, imu().getRoll());  
+                    sprintf(buf, "main loop:  current_state=%d tNow =%d imu.heading=%f  headingLoop.heading= %f  imu.roll = %f  \n\n\r", 
+                                current_state, tNow,imu().getHeading(), headingLoop().getPosition(), imu().getRoll());  
                     mbedLogger().appendDiagFile(buf,3);
                 }
                 if ((tNow % 3000) == 0) {
@@ -454,15 +455,19 @@
             } // end else { at  **88**
             if(current_state == FB_EXIT) {
                 log_loop=true;
-                log_function(); led2()=1; led4()=1;
+                log_function();
+                led2()=1;
+                led4()=1;
                 keeprunning=0;  // and this will force exit to the main while() loop.
                 //  switch state to EOL_WAIT, spit out xbee messages,  wait 60 seconds or so. if keyboard comes back, do not exit
                 sprintf(buf, "INSIDE  main loop: BUT now called to exit out of it via FB_EXIT\n\n\r");
                 mbedLogger().appendDiagFile(buf,3);
             }
-                          if(tNow ==  90000) {  // don't wait forever  -remove this for real operations!!
-                              keeprunning=0;
-                              }
+            if(tNow ==  90000) {  // don't wait forever  -remove this for real operations!!
+                keeprunning=0;
+                sprintf(buf, "INSIDE  main loop: Triggered FINAL timeout at 90 seconds\n\n\r");
+                mbedLogger().appendDiagFile(buf,3);
+            }
         }  // end if(read_ticker) {
     }  // end while(keeprunning)