 |
Paparazzi UAS
v6.1.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
47 #include "generated/modules.h"
50 #define And(x, y) ((x) && (y))
51 #define Or(x, y) ((x) || (y))
52 #define Min(x,y) (x < y ? x : y)
53 #define Max(x,y) (x > y ? x : y)
54 #define LessThan(_x, _y) ((_x) < (_y))
55 #define MoreThan(_x, _y) ((_x) > (_y))
65 PRINT_CONFIG_VAR(MODULES_FREQUENCY)
115 modules_periodic_task();
145 if (rc_lost && ap_lost) {
149 else if (!rc_lost && ap_lost) {
156 else if (rc_lost && !ap_lost) {
199 if (!(dv++ % (PERIODIC_FREQUENCY / 20))) {
LED_TOGGLE(FBW_MODE_LED);}
201 if (!(dv++ % (PERIODIC_FREQUENCY))) {
LED_TOGGLE(FBW_MODE_LED);}
205 #endif // FWB_MODE_LED
235 #ifdef RADIO_KILL_SWITCH
236 static bool kill_state_init =
false;
239 kill_state_init =
true;
264 #ifdef SetCommandsFromRC
267 #warning "FBW: needs commands from RC in order to be useful."
296 modules_event_task();
void radio_control_periodic_task(void)
#define RADIO_FBW_MODE
Switching between FBW and autopilot is done with RADIO_FBW_MODE: default is to re-use RADIO_MODE.
void telemetry_periodic(void)
Rotorcraft Inter-MCU on FlyByWire.
void intermcu_send_status(uint8_t mode)
void mcu_event(void)
MCU event functions.
pprz_t intermcu_commands[COMMANDS_NB]
void InterMcuEvent(void(*frame_handler)(void))
enum intermcu_status status
Status of the INTERMCU.
const pprz_t commands_failsafe[COMMANDS_NB]
void motor_mixing_init(void)
tid_t main_periodic_tid
id for main_periodic() timer
@ INTERMCU_LOST
No interMCU communication anymore.
static void fbw_on_rc_frame(void)
Callback when we received an RC frame.
void intermcu_periodic(void)
tid_t radio_control_tid
id for radio_control_periodic_task() timer
Arch independent mcu ( Micro Controller Unit ) utilities.
void intermcu_on_rc_frame(uint8_t fbw_mode)
void electrical_periodic(void)
Architecture independent timing functions.
tid_t telemetry_tid
id for telemetry_periodic() timer
#define RC_LOST_IN_AUTO_FBW_MODE
mode to enter when AP is lost while using autopilot
static void fbw_safety_check(void)
void electrical_init(void)
int8_t tid_t
sys_time timer id type
arch independent LED (Light Emitting Diodes) API
tid_t electrical_tid
id for electrical_periodic() timer
void radio_control_init(void)
static const ShellCommand commands[]
#define FBW_MODE_AUTO_ONLY
holds whether the aircraft can only be flown with the AP and not RC-Direct/FBW-mode
void handle_periodic_tasks(void)
#define RadioControlEvent(_received_frame_handler)
#define RC_LOST_FBW_MODE
mode to enter when RC is lost while using a mode with RC input
#define AP_LOST_FBW_MODE
mode to enter when AP is lost while using autopilot
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
void main_init(void)
Main initialization.
Hardware independent code for commands handling.
uint8_t autopilot_get_mode(void)
get autopilot mode
#define RADIO_KILL_SWITCH
struct intermcu_t intermcu
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
void mcu_init(void)
Microcontroller peripherals initialization.
static void fbw_on_ap_command(void)
Callback when receive commands from the AP.
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
tid_t modules_tid
id for modules_periodic_task() timer
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]