|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include "idle_task.h"#include "board_bringup.h"#include "board_sleep.h"#include "bringup_task.h"#include "cmsis_os2.h"#include "main.h"#include "mode.h"#include "radio_task.h"Go to the source code of this file.
Macros | |
| #define | EV_MODE (1U << 0) |
| #define | EV_CMD (1U << 1) |
| #define | FRAME_HEARTBEAT 0x01U /* src/radio/frame.h FrameType::Heartbeat */ |
Functions | |
| static self_test_battery_t | read_battery (void *ctx, uint32_t now_ms, uint32_t budget_ms) |
| static bool | on_usb (void *ctx) |
| static self_test_reply_t | send_heartbeat (void *ctx, const idle_heartbeat_t *hb, uint32_t budget_ms) |
| static idle_command_t | poll_command (void *ctx) |
| static bool | work_waiting (void) |
| static void | led1 (bool on) |
| static void | idle_task (void *argument) |
| bool | idle_task_start (void) |
| void | idle_task_set_active (bool on) |
| void | idle_task_command (mode_command_t command) |
| const idle_t * | idle_task_state (void) |
Variables | |
| static const idle_config_t | config |
| static idle_t | idle |
| static osThreadId_t | thread |
| static osMessageQueueId_t | commands |
| static volatile bool | want_active |
| #define EV_CMD (1U << 1) |
Definition at line 12 of file idle_task.c.
Referenced by idle_task(), and idle_task_command().
| #define EV_MODE (1U << 0) |
Definition at line 11 of file idle_task.c.
| #define FRAME_HEARTBEAT 0x01U /* src/radio/frame.h FrameType::Heartbeat */ |
Definition at line 13 of file idle_task.c.
Referenced by send_heartbeat().
|
static |
Definition at line 83 of file idle_task.c.
References app_set_state(), board_sleep(), board_sleep_init(), config, EV_CMD, EV_MODE, FLIGHT_EV_ARM, FLIGHT_IDLE, flight_state_next(), idle, idle_enter(), IDLE_EVENT_ARM_REQUESTED, IDLE_EVENT_SLEEP, idle_init(), idle_on_wake(), led1(), NULL, on_usb(), osFlagsWaitAny, osKernelGetTickCount(), osThreadFlagsWait(), osWaitForever, poll_command(), port, r, read_battery(), send_heartbeat(), want_active, and work_waiting().
Referenced by idle_task_start().
| void idle_task_command | ( | mode_command_t | command | ) |
Definition at line 131 of file idle_task.c.
References commands, EV_CMD, osMessageQueuePut(), osOK, osThreadFlagsSet(), and thread.
Referenced by app_command().
| void idle_task_set_active | ( | bool | on | ) |
Definition at line 124 of file idle_task.c.
References EV_MODE, osThreadFlagsSet(), thread, and want_active.
Referenced by app_set_state().
| bool idle_task_start | ( | void | ) |
Definition at line 113 of file idle_task.c.
References commands, idle_task(), NULL, osMessageQueueNew(), osPriorityBelowNormal, osThreadNew(), and thread.
Referenced by app_start().
| const idle_t * idle_task_state | ( | void | ) |
Definition at line 138 of file idle_task.c.
References idle.
|
static |
Definition at line 78 of file idle_task.c.
References GPIO_PIN_RESET, GPIO_PIN_SET, HAL_GPIO_WritePin(), LED1_GPIO_Port, and LED1_Pin.
Referenced by idle_task().
|
static |
Definition at line 37 of file idle_task.c.
References board_bringup_on_usb().
Referenced by battery_assess(), and idle_task().
|
static |
Definition at line 64 of file idle_task.c.
References commands, IDLE_CMD_ARM, IDLE_CMD_DISARM, IDLE_CMD_NONE, MODE_CMD_ARM, NULL, osMessageQueueGet(), and osOK.
Referenced by idle_task().
|
static |
Definition at line 31 of file idle_task.c.
References board_bringup_read_battery(), and bringup_task_board().
|
static |
Definition at line 42 of file idle_task.c.
References idle_heartbeat_t::battery, FLIGHT_IDLE, FRAME_HEARTBEAT, IDLE_BATT_FAIL, IDLE_BATT_OK, IDLE_BATT_WARN, RADIO_SEND_OK, RADIO_SEND_TIMEOUT, radio_task_send_frame(), SELF_TEST_FAIL, SELF_TEST_PASS, SELF_TEST_TIMEOUT, idle_heartbeat_t::supply_mv, and idle_heartbeat_t::uptime_ms.
|
static |
Definition at line 74 of file idle_task.c.
References commands, osMessageQueueGetCount(), and want_active.
Referenced by idle_task().
|
static |
Definition at line 28 of file idle_task.c.
Referenced by daq::create_actuator_command_packet(), daq::create_pwm_actuator_packet(), idle_task_command(), idle_task_start(), loop(), poll_command(), processActuatorCommand(), processActuatorCommands(), processActuatorCommands(), processIncomingPacket(), processIncomingPacket(), processPWMActuatorCommand(), processPWMActuatorCommand(), fsw::control::PressureStateMachine::sendActuatorCommandUDP(), and work_waiting().
|
static |
Definition at line 17 of file idle_task.c.
Referenced by board_adc_read(), bringup_task(), configureADC(), smart_calibration_gui.SmartCalibrationGUI::confirm_human_input(), smart_calibration_gui.SmartCalibrationGUI::connect(), daq::create_actuator_config_packet(), smart_calibration_gui.SmartCalibrationGUI::create_human_input_request(), smart_calibration_gui.SmartCalibrationGUI::disconnect(), emmc_log_init(), emmc_stm32_init(), EthernetInit(), formatter::formatter(), h3lis_init(), idle_init(), idle_task(), ism330_init(), main(), main(), mount(), on_valset(), daq::parse_actuator_config_packet(), printResults(), self_test_init(), QwDevISM330DHCX::setHubWriteMode(), smart_calibration_gui.SmartCalibrationGUI::skip_human_input(), smart_calibration_gui.SmartCalibrationGUI::start_learning(), smart_calibration_gui.SmartCalibrationGUI::stop_learning(), and smart_calibration_gui.SmartCalibrationGUI::toggle_autonomous_mode().
|
static |
Definition at line 26 of file idle_task.c.
Referenced by idle_enter(), idle_init(), idle_last_heartbeat(), idle_on_wake(), idle_task(), idle_task_state(), main(), read_battery(), send_heartbeat(), setup(), test_arm_requested_without_heartbeat(), test_battery_read_before_transmit(), test_clock_and_sequence_wraparound(), test_command_drain_is_bounded(), test_disarm_stays_idle(), test_disarm_then_arm_in_one_wake(), test_early_lsi_wake_within_tolerance(), test_failure_count_saturates(), test_first_wake_sends_heartbeat(), test_hysteresis(), test_init_rejects_bad_input(), test_invalid_battery_still_sends(), test_long_gap_sends_one_heartbeat(), test_radio_wake_does_not_delay_heartbeat(), test_send_failure_counted_and_sleep_continues(), test_sixty_seconds_gives_six_heartbeats(), test_thresholds(), test_usb_is_never_battery_health(), and test_wake_before_enter_is_error().
|
static |
Definition at line 27 of file idle_task.c.
|
static |
Definition at line 29 of file idle_task.c.