Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
FBW main loop. More...
#include "main_fbw.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "modules/datalink/datalink.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Macros | |
#define | MODULES_C |
#define | ABI_C |
#define | MAIN_FBW_RC_ID ABI_BROADCAST |
ABI RC binding. More... | |
Functions | |
static void | rc_cb (uint8_t sender_id, struct RadioControl *rc) |
Callback when we received an RC frame. More... | |
void | main_fbw_init (void) |
Main initialization. More... | |
static void | fbw_safety_check (void) |
Periodic tasks. More... | |
static void | main_task_periodic (void) |
void | main_fbw_periodic (void) |
void | main_fbw_parse_EMERGENCY_CMD (uint8_t *buf) |
void | main_fbw_event (void) |
Variables | |
uint8_t | fbw_mode |
Fly by wire modes. More... | |
bool | fbw_motors_on = false |
tid_t | periodic_tid |
IDs for timers. More... | |
tid_t | radio_control_tid |
id for radio_control_periodic() timer More... | |
tid_t | electrical_tid |
id for electrical_periodic() timer More... | |
tid_t | telemetry_tid |
id for telemetry_periodic() timer More... | |
static abi_event | rc_ev |
FBW main loop.
Definition in file main_fbw.c.
#define ABI_C |
Definition at line 31 of file main_fbw.c.
#define MAIN_FBW_RC_ID ABI_BROADCAST |
ABI RC binding.
Definition at line 68 of file main_fbw.c.
#define MODULES_C |
Definition at line 29 of file main_fbw.c.
|
static |
Periodic tasks.
Definition at line 106 of file main_fbw.c.
References AP_LOST_FBW_MODE, fbw_mode, FBW_MODE_AUTO, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, intermcu, INTERMCU_LOST, radio_control, RC_LOST_FBW_MODE, RC_LOST_IN_AUTO_FBW_MODE, RC_REALLY_LOST, intermcu_t::status, and RadioControl::status.
Referenced by main_task_periodic().
void main_fbw_event | ( | void | ) |
Definition at line 263 of file main_fbw.c.
References intermcu_event().
void main_fbw_init | ( | void | ) |
Main initialization.
Definition at line 78 of file main_fbw.c.
References electrical_tid, fbw_mode, FBW_MODE_FAILSAFE, MAIN_FBW_RC_ID, periodic_tid, radio_control_tid, rc_cb(), rc_ev, sys_time_register_timer(), and telemetry_tid.
void main_fbw_parse_EMERGENCY_CMD | ( | uint8_t * | buf | ) |
Definition at line 256 of file main_fbw.c.
References fbw_mode, and FBW_MODE_FAILSAFE.
void main_fbw_periodic | ( | void | ) |
Definition at line 187 of file main_fbw.c.
References electrical_periodic(), electrical_tid, main_task_periodic(), periodic_tid, radio_control_tid, sys_time_check_and_ack_timer(), and telemetry_tid.
|
static |
Definition at line 142 of file main_fbw.c.
References commands_failsafe, fbw_mode, FBW_MODE_AUTO, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, fbw_motors_on, fbw_safety_check(), intermcu, intermcu_ap_motors_on, intermcu_commands, LED_OFF, LED_ON, and LED_TOGGLE.
Referenced by main_fbw_periodic().
|
static |
Callback when we received an RC frame.
Definition at line 214 of file main_fbw.c.
References AP_LOST_FBW_MODE, commands, commands_failsafe, fbw_mode, FBW_MODE_AUTO, FBW_MODE_AUTO_ONLY, FBW_MODE_FAILSAFE, FBW_MODE_MANUAL, fbw_motors_on, intermcu, INTERMCU_LOST, MIN_PPRZ, radio_control, RADIO_FBW_MODE, RADIO_KILL_SWITCH, intermcu_t::status, and RadioControl::values.
Referenced by main_fbw_init().
tid_t electrical_tid |
id for electrical_periodic() timer
Definition at line 61 of file main_fbw.c.
Referenced by main_fbw_init(), and main_fbw_periodic().
uint8_t fbw_mode |
Fly by wire modes.
Definition at line 41 of file main_fbw.c.
Referenced by fbw_safety_check(), intermcu_send_status(), main_fbw_init(), main_fbw_parse_EMERGENCY_CMD(), main_task_periodic(), rc_cb(), and send_fbw_status().
bool fbw_motors_on = false |
Definition at line 42 of file main_fbw.c.
Referenced by main_task_periodic(), and rc_cb().
tid_t periodic_tid |
IDs for timers.
id for general periodic task timer
Definition at line 59 of file main_fbw.c.
Referenced by main_fbw_init(), and main_fbw_periodic().
tid_t radio_control_tid |
id for radio_control_periodic() timer
Definition at line 60 of file main_fbw.c.
Referenced by main_fbw_init(), and main_fbw_periodic().
|
static |
Definition at line 71 of file main_fbw.c.
Referenced by main_fbw_init().
tid_t telemetry_tid |
id for telemetry_periodic() timer
Definition at line 62 of file main_fbw.c.
Referenced by main_fbw_init(), and main_fbw_periodic().