31 #include "generated/airframe.h"
32 #include "generated/modules.h"
38 #if PERIODIC_TELEMETRY
46 #if PERIODIC_TELEMETRY
50 #ifndef RECOVERY_RC_ID
51 #define RECOVERY_RC_ID ABI_BROADCAST
56 #define RECOVERY_MODE_OF_PPRZ(mode) ((mode) < THRESHOLD_MANUAL_PPRZ ? RECOVERY_MODE_MANUAL : RECOVERY_MODE_FAILSAFE)
69 #if PERIODIC_TELEMETRY
81 pprz_msg_send_FBW_STATUS(trans,
dev, AC_ID,
97 modules_radio_control_init();
98 modules_actuators_init();
99 modules_datalink_init();
110 #ifdef AP_MODE_MANUAL
117 #if PERIODIC_TELEMETRY
128 modules_mcu_event_task();
129 modules_radio_control_event_task();
130 modules_actuators_event_task();
131 modules_datalink_event_task();
139 modules_mcu_periodic_task();
140 modules_radio_control_periodic_task();
147 modules_actuators_periodic_task();
150 #if !(RECOVERY_DISABLE_ELECTRICAL)
156 #if PERIODIC_TELEMETRY
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
struct pprz_autopilot autopilot
Global autopilot structure.
uint8_t mode
current autopilot mode
const pprz_t commands_failsafe[COMMANDS_NB]
pprz_t commands[COMMANDS_NB]
Hardware independent code for commands handling.
struct Electrical electrical
void electrical_init(void)
void electrical_periodic(void)
Interface for electrical status: supply voltage, current, battery status, etc.
float current
current in A
float vsupply
supply voltage in V
#define AP_MODE_MANUAL
AP modes.
void main_recovery_periodic(void)
tid_t periodic_tid
id for periodic task timer
static void rc_cb(uint8_t sender_id, struct RadioControl *rc)
tid_t electrical_tid
id for electrical_periodic() timer
static void send_fbw_status(struct transport_tx *trans, struct link_device *dev)
#define RECOVERY_MODE_OF_PPRZ(mode)
tid_t telemetry_tid
id for periodic telemetry
void main_recovery_event(void)
void main_recovery_init(void)
Recovery mode: run manual mode in case of hardfault Based on legacy FBW.
#define RECOVERY_MODE_MANUAL
recovery modes
#define RECOVERY_MODE_FAILSAFE
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
struct RadioControl radio_control
Generic interface for radio control modules.
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Utility functions and includes for autopilots.
static const struct usb_device_descriptor dev
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
int8_t tid_t
sys_time timer id type
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.