Contain FSM module with related structures and functions. More...
Data Structures | |
struct | FSM_t |
Structure of FSM specific variables. More... | |
Enumerations | |
enum | systemState_t { INIT, IDLE, CONFIGURE, MISSION, PICKUP, SLEEP, LOWPOWER, FAILURE } |
Type definition of system state enumeration. More... | |
enum | systemEvent_t { Initialize, Init_Finished, HallEffectInterrupt, BLEInterrupt, Failure, MissionStart, MissionFinished, MissionAbort, Sleep } |
Type definition of system events. More... | |
Functions | |
systemState_t | InitStateHandler (void) |
handler to go to initialization state. More... | |
systemState_t | IdleStateHandler (void) |
handler to go to idle state. More... | |
systemState_t | ConfigureStateHandler (void) |
handler to go to configuration state. More... | |
systemState_t | failureHandler (void) |
handler to go to failure state. More... | |
systemState_t | MissionStartHandler (void) |
handler to go to mission state. More... | |
systemState_t | MissionFinishedHandler (void) |
handler to go to PickUp state. More... | |
systemState_t | MissionAbortHandler (void) |
handler to go to failure state upon aborted mission. More... | |
systemState_t | SleepHandler (void) |
handler to go to PickUp state. More... | |
systemState_t | LowPowerHandler (void) |
handler to go to low power state state. More... | |
void | waitForEvent () |
handler to go to failure state. More... | |
void | INITstate (void) |
Initialize Finite state machine after reset. More... | |
void | IDLEstate () |
Idle state, transistion to sleep mode after 2 minutes. More... | |
void | CONFIGUREstate () |
Configure state, BLE advertise to configre vehicle or transfer file. More... | |
void | MISSIONstate () |
Mission state, BLE is disconnected, and mission is started. More... | |
void | PICKUPstate () |
PickUp state, BLE is advertising, and vehicle can be re-configured and/or file transfered. More... | |
void | SLEEPstate (void) |
Sleep state, SD card is unmounted and system is powered down to off-mode. More... | |
void | LOWPOWERstate (void) |
Low Power state, vehicle is floated to surface, SD card is unmounted. More... | |
void | FAILUREstate (void) |
Failure state, vehicle is floated to surface, SD card is unmounted. More... | |
void | FSM (void) |
Main FSM loop. More... | |
Variables | |
FSM_t | fsm |
Create Finite State Machine struct instance. More... | |
Contain FSM module with related structures and functions.
enum systemEvent_t |
enum systemState_t |
void CONFIGUREstate | ( | ) |
Configure state, BLE advertise to configre vehicle or transfer file.
< blue LED.
systemState_t ConfigureStateHandler | ( | void | ) |
handler to go to configuration state.
< Go to CONFIGURE state.
systemState_t failureHandler | ( | void | ) |
handler to go to failure state.
< Go to FAILURE state.
void FAILUREstate | ( | void | ) |
Failure state, vehicle is floated to surface, SD card is unmounted.
void FSM | ( | ) |
Main FSM loop.
void IDLEstate | ( | ) |
Idle state, transistion to sleep mode after 2 minutes.
BLE is not advertising, but system is in run-mode and ready to transition to next state upon hall effect button interrupt. otherwise it goes back to off-mode after 2 min.
< White color at minimum brightness.
systemState_t IdleStateHandler | ( | void | ) |
handler to go to idle state.
< Go to IDLE state.
void INITstate | ( | void | ) |
Initialize Finite state machine after reset.
< Initialize battery to just above LOWPOWER limit.
< Initialize battery to just above LOWPOWER limit.
systemState_t InitStateHandler | ( | void | ) |
handler to go to initialization state.
< Go to INIT state.
systemState_t LowPowerHandler | ( | void | ) |
handler to go to low power state state.
Go to LOWPOWER state.
void LOWPOWERstate | ( | void | ) |
Low Power state, vehicle is floated to surface, SD card is unmounted.
< Red LED.
< Float to surface.
< unmount SD card.
systemState_t MissionAbortHandler | ( | void | ) |
handler to go to failure state upon aborted mission.
< Go to FAILURE state.
systemState_t MissionFinishedHandler | ( | void | ) |
handler to go to PickUp state.
< Go to PICKUP state.
systemState_t MissionStartHandler | ( | void | ) |
handler to go to mission state.
< Go to MISSION state.
void MISSIONstate | ( | ) |
Mission state, BLE is disconnected, and mission is started.
< green LED.
void PICKUPstate | ( | ) |
PickUp state, BLE is advertising, and vehicle can be re-configured and/or file transfered.
< Yellow LED.
systemState_t SleepHandler | ( | void | ) |
handler to go to PickUp state.
< Go to SLEEP state.
void SLEEPstate | ( | void | ) |
Sleep state, SD card is unmounted and system is powered down to off-mode.
void waitForEvent | ( | ) |
handler to go to failure state.
FSM_t fsm |
Create Finite State Machine struct instance.