STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
flight_state.h File Reference
#include <Arduino.h>
Include dependency graph for flight_state.h:
This graph shows which files directly or indirectly include this file:

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 ()

Enumeration Type Documentation

◆ FlightState

enum class FlightState : uint8_t
strong
Enumerator
Idle 
Launch 
Active 
Venting 

Definition at line 5 of file flight_state.h.

Function Documentation

◆ applyActuatorOutputs()

void applyActuatorOutputs ( )

Definition at line 75 of file flight_state.cpp.

References Active, driveAllSolenoids(), Idle, Launch, runNoseConeControlLoop(), s_state, and Venting.

Referenced by loop().

◆ flightStateGet()

FlightState flightStateGet ( )

Definition at line 31 of file flight_state.cpp.

References s_state.

Referenced by loop(), and sensorsShouldLog().

◆ flightStateInit()

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().

◆ flightStateOnActiveTimeout()

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().

◆ flightStateOnApogee()

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().

◆ flightStateOnLaunchDetect()

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().

◆ flightStateTick()

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().

◆ runNoseConeControlLoop()

void runNoseConeControlLoop ( )

Definition at line 71 of file flight_state.cpp.

Referenced by applyActuatorOutputs().