|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <Arduino.h>Go to the source code of this file.
Enumerations | |
| enum class | FlightState : uint8_t { Idle = 0 , Launch = 1 , Active = 2 , Venting = 3 } |
Functions | |
| void | flightStateInit () |
| FlightState | flightStateGet () |
| void | flightStateTick () |
| void | flightStateOnLaunchDetect () |
| Idle → Launch (call from main when LIS3 launch ISR fires). | |
| void | flightStateOnApogee () |
| Launch → Active when apogee algorithm confirms (only valid from Launch). | |
| void | flightStateOnActiveTimeout () |
| Active → Venting when Active timer expires. | |
| void | applyActuatorOutputs () |
| void | runNoseConeControlLoop () |
|
strong |
| Enumerator | |
|---|---|
| Idle | |
| Launch | |
| Active | |
| Venting | |
Definition at line 5 of file flight_state.h.
| void applyActuatorOutputs | ( | ) |
Definition at line 75 of file flight_state.cpp.
References Active, driveAllSolenoids(), Idle, Launch, runNoseConeControlLoop(), s_state, and Venting.
Referenced by loop().
| FlightState flightStateGet | ( | ) |
Definition at line 31 of file flight_state.cpp.
References s_state.
Referenced by loop(), and sensorsShouldLog().
| void flightStateInit | ( | ) |
Definition at line 20 of file flight_state.cpp.
References digitalWrite(), LOW, OUTPUT, p, PIN_DRIVE_1, PIN_DRIVE_2, PIN_DRIVE_3, PIN_DRIVE_4, PIN_DRIVE_5, PIN_DRIVE_6, and pinMode().
Referenced by setup().
| void flightStateOnActiveTimeout | ( | ) |
Active → Venting when Active timer expires.
Definition at line 58 of file flight_state.cpp.
References Active, s_state, transitionTo(), and Venting.
Referenced by flightStateTick().
| void flightStateOnApogee | ( | ) |
Launch → Active when apogee algorithm confirms (only valid from Launch).
Definition at line 50 of file flight_state.cpp.
References Active, apogeeReset(), Launch, millis(), s_activeEnterMs, s_state, and transitionTo().
Referenced by loop().
| void flightStateOnLaunchDetect | ( | ) |
Idle → Launch (call from main when LIS3 launch ISR fires).
Definition at line 43 of file flight_state.cpp.
References apogeeReset(), Idle, Launch, s_state, and transitionTo().
Referenced by loop().
| void flightStateTick | ( | ) |
Definition at line 64 of file flight_state.cpp.
References Active, ACTIVE_DURATION_MS, flightStateOnActiveTimeout(), millis(), s_activeEnterMs, and s_state.
Referenced by loop().
| void runNoseConeControlLoop | ( | ) |
Definition at line 71 of file flight_state.cpp.
Referenced by applyActuatorOutputs().