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

System/StaticDefs.cpp

Committer:
mkelly10
Date:
2017-10-20
Revision:
9:d5fcdcb3c89d
Child:
10:085ab7328054

File content as of revision 9:d5fcdcb3c89d:

#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;    
}