CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
rtos_bootup_operation_fsm_task.c File Reference
Include dependency graph for rtos_bootup_operation_fsm_task.c:

Functions

static void set_operation_state_and_log_if_changed (CTS1_operation_state_enum_t new_state, const char *reason_str)
 
static uint8_t does_filesystem_have_bypass_deployment_and_enable_radio_file (void)
 Check if the filesystem has the file "/bypass_deployment_and_enable_radio.txt".
 
static uint8_t have_all_antennas_deployed (enum ANT_i2c_bus_mcu ant_bus)
 Power on EPS channel, check if all antennas have been deployed.
 
static void SUBTASK_bootup_operation_state_check_for_state_transitions (void)
 State machine for the bootup operation state.
 
static void SUBTASK_deployment_state_execute (void)
 
static void pulse_external_led_blocking (uint32_t pulse_duration_ms)
 
static void SUBTASK_bootup_operation_state_do_led_indication_action (void)
 
void TASK_bootup_operation_fsm (void *argument)
 FreeRTOS task - FSM which handles the bootup and operation state/state.
 
char * CTS1_operation_state_enum_TO_str (CTS1_operation_state_enum_t state)
 

Variables

uint32_t COMMS_uptime_to_start_ant_deployment_sec = 30 * 60
 The uptime, as defined in the Launch Provider ICD, at which the antennas should be deployed.
 
CTS1_operation_state_enum_t CTS1_operation_state = CTS1_OPERATION_STATE_BOOTED_AND_WAITING
 

Function Documentation

◆ CTS1_operation_state_enum_TO_str()

char * CTS1_operation_state_enum_TO_str ( CTS1_operation_state_enum_t state)
Here is the caller graph for this function:

◆ does_filesystem_have_bypass_deployment_and_enable_radio_file()

static uint8_t does_filesystem_have_bypass_deployment_and_enable_radio_file ( void )
static

Check if the filesystem has the file "/bypass_deployment_and_enable_radio.txt".

Returns
If the file exists, return 1. If it does not exist, or on failure, return 0.
Note
This function returns the same result on failure as on non-existence. The distinction is not useful to the caller.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ have_all_antennas_deployed()

static uint8_t have_all_antennas_deployed ( enum ANT_i2c_bus_mcu ant_bus)
static

Power on EPS channel, check if all antennas have been deployed.

Note
This function returns the same result on failure as on "antennas not deployed". The distinction is not useful to the caller.
Returns
1 if all antennas are deployed. 0 if not all antennas are deployed. 0 if an error occurs.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pulse_external_led_blocking()

static void pulse_external_led_blocking ( uint32_t pulse_duration_ms)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_operation_state_and_log_if_changed()

static void set_operation_state_and_log_if_changed ( CTS1_operation_state_enum_t new_state,
const char * reason_str )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SUBTASK_bootup_operation_state_check_for_state_transitions()

static void SUBTASK_bootup_operation_state_check_for_state_transitions ( void )
inlinestatic

State machine for the bootup operation state.

Note
Implemented per https://github.com/CalgaryToSpace/CTS-SAT-1-OBC-Firmware/issues/420
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SUBTASK_bootup_operation_state_do_led_indication_action()

static void SUBTASK_bootup_operation_state_do_led_indication_action ( void )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SUBTASK_deployment_state_execute()

static void SUBTASK_deployment_state_execute ( void )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TASK_bootup_operation_fsm()

void TASK_bootup_operation_fsm ( void * argument)

FreeRTOS task - FSM which handles the bootup and operation state/state.

During LEOPS (launch and early operations), it deploys the comms antennas and permits radio TX. During the rest of the mission, it bypasses the 30 minute deployment wait time, and also blinks the LED to indicate the current state.

Note
Implemented per https://github.com/CalgaryToSpace/CTS-SAT-1-OBC-Firmware/issues/420
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ COMMS_uptime_to_start_ant_deployment_sec

uint32_t COMMS_uptime_to_start_ant_deployment_sec = 30 * 60

The uptime, as defined in the Launch Provider ICD, at which the antennas should be deployed.

◆ CTS1_operation_state