From 7dfc6f97095cade5c5561d07e30bfbbd36421848 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Wed, 19 Oct 2011 22:58:02 +0200 Subject: [PATCH] started reviving settings via remote control, to use it add to your airframe file --- conf/airframes/flixr_discovery.xml | 1 + .../subsystems/fixedwing/settings_rc.makefile | 6 ++++++ conf/settings/tuning_ins_rc.xml | 18 ++++++++++++++++++ sw/airborne/rc_settings.c | 2 +- sw/airborne/rc_settings.h | 12 +++++------- 5 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 conf/autopilot/subsystems/fixedwing/settings_rc.makefile create mode 100644 conf/settings/tuning_ins_rc.xml diff --git a/conf/airframes/flixr_discovery.xml b/conf/airframes/flixr_discovery.xml index 15e48224069..2f4019f0cc4 100644 --- a/conf/airframes/flixr_discovery.xml +++ b/conf/airframes/flixr_discovery.xml @@ -32,6 +32,7 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation + diff --git a/conf/autopilot/subsystems/fixedwing/settings_rc.makefile b/conf/autopilot/subsystems/fixedwing/settings_rc.makefile new file mode 100644 index 00000000000..c372f43b17f --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing/settings_rc.makefile @@ -0,0 +1,6 @@ +# Hey Emacs, this is a -*- makefile -*- + +# change settings via Remote Control, e.g. tune your aircraft + +$(TARGET).srcs += rc_settings.c +$(TARGET).CFLAGS += -DRADIO_CONTROL_SETTINGS diff --git a/conf/settings/tuning_ins_rc.xml b/conf/settings/tuning_ins_rc.xml new file mode 100644 index 00000000000..2249537bd2f --- /dev/null +++ b/conf/settings/tuning_ins_rc.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/sw/airborne/rc_settings.c b/sw/airborne/rc_settings.c index 91cdc614e76..d64857a4b45 100644 --- a/sw/airborne/rc_settings.c +++ b/sw/airborne/rc_settings.c @@ -25,8 +25,8 @@ #include -#include "rc_settings.h" #include "generated/radio.h" +#include "rc_settings.h" #include "autopilot.h" #include "subsystems/nav.h" #include "subsystems/sensors/infrared.h" diff --git a/sw/airborne/rc_settings.h b/sw/airborne/rc_settings.h index 0cbd78de785..2fd8677e251 100644 --- a/sw/airborne/rc_settings.h +++ b/sw/airborne/rc_settings.h @@ -28,11 +28,8 @@ * * The 'rc_control' section of a XML flight plan allows the user to change the * value of an autopilot internal variable through the rc transmitter. - * C code is generated from this XML code (var/AC/inflight_calib.h). This - * module handles the control of this setting mode. + * This module handles the control of this setting mode. * - * Note that this functionnality is deprecated since datalink use is a lot more - * easier ('dl_settings' section) */ #ifndef RC_SETTINGS_H @@ -46,6 +43,10 @@ #define RC_SETTINGS_MODE_DOWN 1 #define RC_SETTINGS_MODE_UP 2 +extern uint8_t rc_settings_mode; + +void rc_settings(bool_t mode_changed); + #define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE) #define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < TRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \ @@ -55,9 +56,6 @@ #define RcSettingsModeUpdate(_rc_channels) \ ModeUpdate(rc_settings_mode, RC_SETTINGS_MODE_OF_PULSE(_rc_channels[RADIO_CALIB])) -extern uint8_t rc_settings_mode; -void rc_settings(bool_t mode_changed); - #else /* RADIO_CALIB && defined RADIO_CONTROL_SETTINGS */