From a5586ec3942e19034ea800a4262cd4e3bc543ee0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Jun 2013 12:48:58 +1000 Subject: [PATCH] Rover: enable RELAY_* parameters --- APMrover2/Parameters.h | 1 + APMrover2/Parameters.pde | 4 ++++ APMrover2/config.h | 7 ------- APMrover2/system.pde | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/APMrover2/Parameters.h b/APMrover2/Parameters.h index c3578fbc24..c378848263 100644 --- a/APMrover2/Parameters.h +++ b/APMrover2/Parameters.h @@ -33,6 +33,7 @@ public: k_param_reset_switch_chan, k_param_initial_mode, k_param_scheduler, + k_param_relay, // IO pins k_param_rssi_pin = 20, diff --git a/APMrover2/Parameters.pde b/APMrover2/Parameters.pde index 4f43e1ea29..a6265646ff 100644 --- a/APMrover2/Parameters.pde +++ b/APMrover2/Parameters.pde @@ -422,6 +422,10 @@ const AP_Param::Info var_info[] PROGMEM = { // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp GOBJECT(scheduler, "SCHED_", AP_Scheduler), + // @Group: RELAY_ + // @Path: ../libraries/AP_Relay/AP_Relay.cpp + GOBJECT(relay, "RELAY_", AP_Relay), + // @Group: RCMAP_ // @Path: ../libraries/AP_RCMapper/AP_RCMapper.cpp GOBJECT(rcmap, "RCMAP_", RCMapper), diff --git a/APMrover2/config.h b/APMrover2/config.h index 4024769048..f6b9691f3e 100644 --- a/APMrover2/config.h +++ b/APMrover2/config.h @@ -36,9 +36,6 @@ // default choices for a 1280. We can't fit everything in, so we // make some popular choices by default #define LOGGING_ENABLED DISABLED - #ifndef CONFIG_RELAY - # define CONFIG_RELAY DISABLED - #endif #ifndef MOUNT2 # define MOUNT2 DISABLED #endif @@ -74,14 +71,12 @@ # define SLIDE_SWITCH_PIN 40 # define PUSHBUTTON_PIN 41 # define USB_MUX_PIN -1 -# define CONFIG_RELAY ENABLED # define BATTERY_PIN_1 0 # define CURRENT_PIN_1 1 #elif CONFIG_HAL_BOARD == HAL_BOARD_APM2 # define CONFIG_INS_TYPE CONFIG_INS_MPU6000 # define CONFIG_COMPASS AP_COMPASS_HMC5843 # define CONFIG_PUSHBUTTON DISABLED -# define CONFIG_RELAY DISABLED # define A_LED_PIN 27 # define B_LED_PIN 26 # define C_LED_PIN 25 @@ -97,7 +92,6 @@ # define CONFIG_INS_TYPE CONFIG_INS_STUB # define CONFIG_COMPASS AP_COMPASS_HIL # define CONFIG_PUSHBUTTON DISABLED -# define CONFIG_RELAY DISABLED # define A_LED_PIN 27 # define B_LED_PIN 26 # define C_LED_PIN 25 @@ -113,7 +107,6 @@ # define CONFIG_INS_TYPE CONFIG_INS_PX4 # define CONFIG_COMPASS AP_COMPASS_PX4 # define CONFIG_PUSHBUTTON DISABLED -# define CONFIG_RELAY DISABLED # define A_LED_PIN 27 # define B_LED_PIN 26 # define C_LED_PIN 25 diff --git a/APMrover2/system.pde b/APMrover2/system.pde index 302d922b7b..7de80b90df 100644 --- a/APMrover2/system.pde +++ b/APMrover2/system.pde @@ -206,9 +206,7 @@ static void init_ardupilot() #if CONFIG_PUSHBUTTON == ENABLED pinMode(PUSHBUTTON_PIN, INPUT); // unused #endif -#if CONFIG_RELAY == ENABLED relay.init(); -#endif /* setup the 'main loop is dead' check. Note that this relies on