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:
10:085ab7328054
Parent:
9:d5fcdcb3c89d
Child:
11:3b241ecb75ed
--- a/System/StaticDefs.cpp	Fri Oct 20 11:41:22 2017 +0000
+++ b/System/StaticDefs.cpp	Mon Oct 23 12:50:53 2017 +0000
@@ -1,53 +1,79 @@
 #include "StaticDefs.hpp"
 
-//Declare static global variables using 'construct on use' idiom to ensure they are always constructed correctly
-// and avoid "static initialization order fiasco".
+//Declare static global variables using 'construct on use' idiom to ensure they 
+// are always constructed correctly and avoid "static initialization order fiasco".
 
-Timer &systemTime()
-{
+Timer & systemTime() {
     static Timer s;
     return s;
 }
 
-Serial & pc()
-{
-    //static MODSERIAL p(USBTX, USBRX, 512, 512); // tx, rx
-    static Serial p(USBTX, USBRX);
+Ticker & pulse() {
+    static Ticker pulse;
+    return pulse;   
+}
+    
+Serial & pc() {
+    static Serial p(USBTX, USBRX); // tx, rx
     return p;
 }
 
-SpiADC & adc()
-{
-    static SpiADC adc;
+LocalFileSystem & local() {
+    static LocalFileSystem local("local");
+    return local;    
+} 
+
+SpiADC & adc() {
+    static SpiADC adc(p5,p6,p7,p8,LED2);
     return adc;
 }
 
-LinearActuator & bce()
-{
+LinearActuator & bce() {
     static LinearActuator bce(0.01, p25, p29, p30, p18, 0); //interval , pwm, dir, reset, limit switch, adc channel
     return bce;
 }
 
-LinearActuator & batt()
-{
+LinearActuator & batt() {
     static LinearActuator batt(0.01, p23, p21, p22, p17, 1); //interval , pwm, dir, reset, limit switchm, adc channel
     return batt;       
 }
 
-LocalFileSystem & local()
-{
-    static LocalFileSystem local("local");
-    return local;    
-} 
+omegaPX209 & depth() {
+    static omegaPX209 depth(p19); // pin
+    return depth;
+}
 
-PIDController & DepthController()
-{
-    static PIDController DepthController;
-    return DepthController;
+IMU & imu() {
+    static IMU imu(p13,p14); // tx, rx pin
+    return imu;    
+}
+
+OuterLoop & depthLoop() {
+    static OuterLoop depthLoop(0.1, 0); // interval, sensor type
+    return depthLoop;
+}
+
+OuterLoop & pitchLoop() {
+    static OuterLoop pitchLoop(0.1, 1); // interval, sensor type
+    return pitchLoop;
 }
 
-IMU & Microstrain()
-{
-    static IMU Microstrain;
-    return Microstrain;    
+DigitalOut & led1() {
+    static DigitalOut led1(LED1);
+    return led1;
+}
+
+DigitalOut & led2() {
+    static DigitalOut led2(LED2);
+    return led2;
+}
+
+DigitalOut & led3() {
+    static DigitalOut led3(LED3);
+    return led3;
+}
+
+DigitalOut & led4() {
+    static DigitalOut led4(LED4);
+    return led4;
 }
\ No newline at end of file