|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include "flight_state.h"#include "apogee.h"#include "config.h"#include "flight_log.h"#include "pins.h"Go to the source code of this file.
Functions | |
| static void | driveAllSolenoids (bool high) |
| void | flightStateInit () |
| FlightState | flightStateGet () |
| static void | transitionTo (FlightState to, uint8_t reason) |
| 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 | flightStateTick () |
| void | runNoseConeControlLoop () |
| void | applyActuatorOutputs () |
Variables | |
| static FlightState | s_state = FlightState::Idle |
| static uint32_t | s_activeEnterMs = 0 |
| void applyActuatorOutputs | ( | ) |
Definition at line 75 of file flight_state.cpp.
References Active, driveAllSolenoids(), Idle, Launch, runNoseConeControlLoop(), s_state, and Venting.
Referenced by loop().
|
static |
Definition at line 11 of file flight_state.cpp.
References digitalWrite(), HIGH, LOW, p, PIN_DRIVE_1, PIN_DRIVE_2, PIN_DRIVE_3, PIN_DRIVE_4, PIN_DRIVE_5, and PIN_DRIVE_6.
Referenced by applyActuatorOutputs().
| 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().
|
static |
Definition at line 35 of file flight_state.cpp.
References logFlightStateTransition(), millis(), and s_state.
Referenced by flightStateOnActiveTimeout(), flightStateOnApogee(), and flightStateOnLaunchDetect().
|
static |
Definition at line 9 of file flight_state.cpp.
Referenced by flightStateOnApogee(), and flightStateTick().
|
static |
Definition at line 8 of file flight_state.cpp.
Referenced by applyActuatorOutputs(), flightStateGet(), flightStateOnActiveTimeout(), flightStateOnApogee(), flightStateOnLaunchDetect(), flightStateTick(), and transitionTo().