diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index f058799f7b..b1fc79ef45 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -233,8 +233,9 @@ AP_HAL::AnalogSource * batt_curr_pin; // Relay //////////////////////////////////////////////////////////////////////////////// +#if CONFIG_RELAY == ENABLED AP_Relay relay; - +#endif //////////////////////////////////////////////////////////////////////////////// diff --git a/ArduPlane/commands_logic.pde b/ArduPlane/commands_logic.pde index 1cebea55bf..3a7853ce16 100644 --- a/ArduPlane/commands_logic.pde +++ b/ArduPlane/commands_logic.pde @@ -583,6 +583,7 @@ static void do_set_servo() static void do_set_relay() { +#if CONFIG_RELAY == ENABLED if (next_nonnav_command.p1 == 1) { relay.on(); } else if (next_nonnav_command.p1 == 0) { @@ -590,6 +591,7 @@ static void do_set_relay() }else{ relay.toggle(); } +#endif } static void do_repeat_servo(uint8_t channel, uint16_t servo_value, diff --git a/ArduPlane/config.h b/ArduPlane/config.h index e3e6839289..9f587a4d4d 100644 --- a/ArduPlane/config.h +++ b/ArduPlane/config.h @@ -60,13 +60,13 @@ #if defined( __AVR_ATmega1280__ ) // default choices for a 1280. We can't fit everything in, so we - // make some popular choices + // make some popular choices by default #define LOGGING_ENABLED DISABLED #ifndef CONFIG_RELAY - # define CONFIG_RELAY DISABLED + # define CONFIG_RELAY DISABLED #endif #ifndef GEOFENCE_ENABLED - # define GEOFENCE_ENABLED DISABLED + # define GEOFENCE_ENABLED DISABLED #endif #ifndef CLI_ENABLED # define CLI_ENABLED DISABLED @@ -75,7 +75,7 @@ # define MOUNT2 DISABLED #endif #ifndef MOUNT - # define MOUNT ENABLED + # define MOUNT DISABLED #endif #ifndef CAMERA # define CAMERA DISABLED diff --git a/ArduPlane/events.pde b/ArduPlane/events.pde index 833d1ef1ea..7abc117469 100644 --- a/ArduPlane/events.pde +++ b/ArduPlane/events.pde @@ -113,9 +113,11 @@ static void update_events(void) } break; +#if CONFIG_RELAY == ENABLED case EVENT_TYPE_RELAY: relay.toggle(); break; +#endif } if (event_state.repeat > 0) {