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

Committer:
mkelly10
Date:
Fri Oct 20 11:41:22 2017 +0000
Revision:
9:d5fcdcb3c89d
Child:
10:085ab7328054
Tested 10/19/17 Folders

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mkelly10 9:d5fcdcb3c89d 1 #include "StaticDefs.hpp"
mkelly10 9:d5fcdcb3c89d 2
mkelly10 9:d5fcdcb3c89d 3 //Declare static global variables using 'construct on use' idiom to ensure they are always constructed correctly
mkelly10 9:d5fcdcb3c89d 4 // and avoid "static initialization order fiasco".
mkelly10 9:d5fcdcb3c89d 5
mkelly10 9:d5fcdcb3c89d 6 Timer &systemTime()
mkelly10 9:d5fcdcb3c89d 7 {
mkelly10 9:d5fcdcb3c89d 8 static Timer s;
mkelly10 9:d5fcdcb3c89d 9 return s;
mkelly10 9:d5fcdcb3c89d 10 }
mkelly10 9:d5fcdcb3c89d 11
mkelly10 9:d5fcdcb3c89d 12 Serial & pc()
mkelly10 9:d5fcdcb3c89d 13 {
mkelly10 9:d5fcdcb3c89d 14 //static MODSERIAL p(USBTX, USBRX, 512, 512); // tx, rx
mkelly10 9:d5fcdcb3c89d 15 static Serial p(USBTX, USBRX);
mkelly10 9:d5fcdcb3c89d 16 return p;
mkelly10 9:d5fcdcb3c89d 17 }
mkelly10 9:d5fcdcb3c89d 18
mkelly10 9:d5fcdcb3c89d 19 SpiADC & adc()
mkelly10 9:d5fcdcb3c89d 20 {
mkelly10 9:d5fcdcb3c89d 21 static SpiADC adc;
mkelly10 9:d5fcdcb3c89d 22 return adc;
mkelly10 9:d5fcdcb3c89d 23 }
mkelly10 9:d5fcdcb3c89d 24
mkelly10 9:d5fcdcb3c89d 25 LinearActuator & bce()
mkelly10 9:d5fcdcb3c89d 26 {
mkelly10 9:d5fcdcb3c89d 27 static LinearActuator bce(0.01, p25, p29, p30, p18, 0); //interval , pwm, dir, reset, limit switch, adc channel
mkelly10 9:d5fcdcb3c89d 28 return bce;
mkelly10 9:d5fcdcb3c89d 29 }
mkelly10 9:d5fcdcb3c89d 30
mkelly10 9:d5fcdcb3c89d 31 LinearActuator & batt()
mkelly10 9:d5fcdcb3c89d 32 {
mkelly10 9:d5fcdcb3c89d 33 static LinearActuator batt(0.01, p23, p21, p22, p17, 1); //interval , pwm, dir, reset, limit switchm, adc channel
mkelly10 9:d5fcdcb3c89d 34 return batt;
mkelly10 9:d5fcdcb3c89d 35 }
mkelly10 9:d5fcdcb3c89d 36
mkelly10 9:d5fcdcb3c89d 37 LocalFileSystem & local()
mkelly10 9:d5fcdcb3c89d 38 {
mkelly10 9:d5fcdcb3c89d 39 static LocalFileSystem local("local");
mkelly10 9:d5fcdcb3c89d 40 return local;
mkelly10 9:d5fcdcb3c89d 41 }
mkelly10 9:d5fcdcb3c89d 42
mkelly10 9:d5fcdcb3c89d 43 PIDController & DepthController()
mkelly10 9:d5fcdcb3c89d 44 {
mkelly10 9:d5fcdcb3c89d 45 static PIDController DepthController;
mkelly10 9:d5fcdcb3c89d 46 return DepthController;
mkelly10 9:d5fcdcb3c89d 47 }
mkelly10 9:d5fcdcb3c89d 48
mkelly10 9:d5fcdcb3c89d 49 IMU & Microstrain()
mkelly10 9:d5fcdcb3c89d 50 {
mkelly10 9:d5fcdcb3c89d 51 static IMU Microstrain;
mkelly10 9:d5fcdcb3c89d 52 return Microstrain;
mkelly10 9:d5fcdcb3c89d 53 }