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: System/StaticDefs.cpp
- Revision:
- 9:d5fcdcb3c89d
- Child:
- 10:085ab7328054
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/System/StaticDefs.cpp Fri Oct 20 11:41:22 2017 +0000 @@ -0,0 +1,53 @@ +#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". + +Timer &systemTime() +{ + static Timer s; + return s; +} + +Serial & pc() +{ + //static MODSERIAL p(USBTX, USBRX, 512, 512); // tx, rx + static Serial p(USBTX, USBRX); + return p; +} + +SpiADC & adc() +{ + static SpiADC adc; + return adc; +} + +LinearActuator & bce() +{ + static LinearActuator bce(0.01, p25, p29, p30, p18, 0); //interval , pwm, dir, reset, limit switch, adc channel + return bce; +} + +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; +} + +PIDController & DepthController() +{ + static PIDController DepthController; + return DepthController; +} + +IMU & Microstrain() +{ + static IMU Microstrain; + return Microstrain; +} \ No newline at end of file