Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Rotorcraft FBW main loop. More...
#include <inttypes.h>
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "led.h"
#include "subsystems/commands.h"
#include "subsystems/actuators.h"
#include "subsystems/electrical.h"
#include "subsystems/radio_control.h"
#include "subsystems/intermcu/intermcu_fbw.h"
#include "firmwares/rotorcraft/main_fbw.h"
#include "firmwares/rotorcraft/autopilot_rc_helpers.h"
Go to the source code of this file.
Enumerations | |
enum | fbw_mode_enum { FBW_MODE_MANUAL = 0, FBW_MODE_AUTO = 1, FBW_MODE_FAILSAFE = 2 } |
Fly by wire modes. More... | |
Functions | |
int | main (void) |
STATIC_INLINE void | main_init (void) |
STATIC_INLINE void | handle_periodic_tasks (void) |
STATIC_INLINE void | telemetry_periodic (void) |
STATIC_INLINE void | main_periodic (void) |
static void | autopilot_on_rc_frame (void) |
static void | autopilot_on_ap_command (void) |
STATIC_INLINE void | main_event (void) |
Variables | |
fbw_mode_enum | fbw_mode |
tid_t | main_periodic_tid |
id for main_periodic() timer More... | |
tid_t | radio_control_tid |
id for radio_control_periodic_task() timer More... | |
tid_t | electrical_tid |
id for electrical_periodic() timer More... | |
tid_t | telemetry_tid |
id for telemetry_periodic() timer More... | |
Rotorcraft FBW main loop.
Definition in file main_fbw.c.
enum fbw_mode_enum |
Fly by wire modes.
Enumerator | |
---|---|
FBW_MODE_MANUAL | |
FBW_MODE_AUTO | |
FBW_MODE_FAILSAFE |
Definition at line 53 of file main_fbw.c.
|
static |
Definition at line 222 of file main_fbw.c.
References fbw_mode, FBW_MODE_MANUAL, intermcu_commands, and SetCommands.
Referenced by main_event().
|
static |
Definition at line 194 of file main_fbw.c.
References AP_LOST_FBW_MODE, commands, fbw_mode, FBW_MODE_AUTO, FBW_MODE_MANUAL, inter_mcu, INTERMCU_LOST, intermcu_on_rc_frame(), MIN_PPRZ, radio_control, RADIO_FBW_MODE, intermcu_t::status, and RadioControl::values.
Referenced by main_event().
STATIC_INLINE void handle_periodic_tasks | ( | void | ) |
Definition at line 116 of file main_fbw.c.
References baro_periodic(), electrical_periodic(), electrical_tid, failsafe_check(), main_periodic(), main_periodic_tid, radio_control_periodic_task(), radio_control_tid, sys_time_check_and_ack_timer(), telemetry_periodic(), and telemetry_tid.
Referenced by main().
int main | ( | void | ) |
Definition at line 68 of file main_fbw.c.
References handle_periodic_tasks(), main_event(), and main_init().
|
inline |
Definition at line 229 of file main_fbw.c.
References autopilot_on_ap_command(), autopilot_on_rc_frame(), autopilot_rc, BaroEvent, DatalinkEvent, DetectGroundEvent(), GpsEvent, ImuEvent, InsEvent, InterMcuEvent(), mcu_event(), and RadioControlEvent.
Referenced by main().
|
inline |
Definition at line 81 of file main_fbw.c.
References ahrs_aligner_init(), ahrs_init(), autopilot_init(), baro_init(), BARO_PERIODIC_FREQUENCY, Imu::body_to_imu, downlink_init(), electrical_init(), electrical_tid, failsafe_check(), fbw_mode, FBW_MODE_FAILSAFE, gps_init(), imu, imu_init(), ins_init(), intermcu_init(), main_periodic_tid, mcu_init(), mcu_int_enable, motor_mixing_init(), orientationGetQuat_f(), PERIODIC_FREQUENCY, radio_control_init(), radio_control_tid, settings_init(), stateInit(), sys_time_register_timer(), TELEMETRY_FREQUENCY, and telemetry_tid.
Referenced by main().
|
inline |
Definition at line 146 of file main_fbw.c.
References AP_LOST_FBW_MODE, autopilot_flight_time, autopilot_in_flight, autopilot_mode, autopilot_periodic(), commands, commands_failsafe, datalink_time, fbw_mode, FBW_MODE_AUTO, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, imu_periodic(), inter_mcu, INTERMCU_LOST, intermcu_periodic(), intermcu_set_actuators(), LED_PERIODIC, PERIODIC_FREQUENCY, radio_control, RC_LOST_FBW_MODE, RC_LOST_IN_AUTO_FBW_MODE, RC_REALLY_LOST, SetCommands, intermcu_t::status, and RadioControl::status.
Referenced by handle_periodic_tasks().
STATIC_INLINE void telemetry_periodic | ( | void | ) |
Definition at line 136 of file main_fbw.c.
References DefaultChannel, DefaultDevice, DefaultPeriodic, FALSE, fbw_mode, intermcu_send_status(), send_autopilot_version(), and TRUE.
Referenced by handle_periodic_tasks().
tid_t electrical_tid |
id for electrical_periodic() timer
Definition at line 64 of file main_fbw.c.
fbw_mode_enum fbw_mode |
Definition at line 54 of file main_fbw.c.
tid_t main_periodic_tid |
id for main_periodic() timer
Definition at line 61 of file main_fbw.c.
Referenced by handle_periodic_tasks(), and main_init().
tid_t radio_control_tid |
id for radio_control_periodic_task() timer
Definition at line 63 of file main_fbw.c.
Referenced by handle_periodic_tasks(), and main_init().
tid_t telemetry_tid |
id for telemetry_periodic() timer
Definition at line 65 of file main_fbw.c.
Referenced by handle_periodic_tasks(), and main_init().