From 6b1e8930f22a3763069d7cb25991e56d205e0f25 Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Wed, 19 Apr 2017 21:43:14 +0200 Subject: [PATCH] update some old variable names for autopilot mode --- sw/airborne/modules/switching/auto1_commands.c | 2 +- sw/misc/rctx/main_rctx.c | 2 +- sw/tools/generators/gen_settings.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/airborne/modules/switching/auto1_commands.c b/sw/airborne/modules/switching/auto1_commands.c index 12bee8587f5..80a95ce7b16 100644 --- a/sw/airborne/modules/switching/auto1_commands.c +++ b/sw/airborne/modules/switching/auto1_commands.c @@ -28,7 +28,7 @@ void periodic_auto1_commands(void) { // Copy Radio commands in AUTO1 - if (pprz_mode == AP_MODE_AUTO1) { + if (autopilot_get_mode() == AP_MODE_AUTO1) { #ifdef COMMAND_HATCH #ifndef RADIO_HATCH #error auto1_commands COMMAND_HATCH needs RADIO_HATCH channel diff --git a/sw/misc/rctx/main_rctx.c b/sw/misc/rctx/main_rctx.c index 175d174bfc3..c1e3a69541a 100644 --- a/sw/misc/rctx/main_rctx.c +++ b/sw/misc/rctx/main_rctx.c @@ -177,7 +177,7 @@ void event_task_rctx( void) { #ifdef USE_RCTX_MODE_SWITCH // TODO: set rxtx_mode from GPIO connected switch (e.g. I2C pins) #else - rctx_mode = PPRZ_MODE_OF_PULSE(rc_values[RADIO_MODE], 0) & 3; + rctx_mode = AP_MODE_OF_PULSE(rc_values[RADIO_MODE], 0) & 3; #endif rctx_mode |= rctx_under_voltage << 2; diff --git a/sw/tools/generators/gen_settings.ml b/sw/tools/generators/gen_settings.ml index 17ef682727e..2e47ce2d213 100644 --- a/sw/tools/generators/gen_settings.ml +++ b/sw/tools/generators/gen_settings.ml @@ -268,7 +268,7 @@ let parse_rc_setting = fun xml -> let parse_rc_mode = fun xml -> - lprintf "if (pprz_mode == PPRZ_MODE_%s) { \\\n" (ExtXml.attrib xml "name"); + lprintf "if (autopilot_get_mode() == AP_MODE_%s) { \\\n" (ExtXml.attrib xml "name"); right (); List.iter parse_rc_setting (Xml.children xml); left (); lprintf "} \\\n"