From 47418b78d6086ce3985b08cee4edd3b59c27f043 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 23 Oct 2014 21:15:02 +0900 Subject: [PATCH] Relay: reduce num relays to 2 --- libraries/AP_Relay/AP_Relay.cpp | 4 ++++ libraries/AP_Relay/AP_Relay.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Relay/AP_Relay.cpp b/libraries/AP_Relay/AP_Relay.cpp index 75fe1e175c..7fb362a4d3 100644 --- a/libraries/AP_Relay/AP_Relay.cpp +++ b/libraries/AP_Relay/AP_Relay.cpp @@ -42,19 +42,23 @@ const AP_Param::GroupInfo AP_Relay::var_info[] PROGMEM = { // @Values: -1:Disabled,13:APM2 A9 pin,47:APM1 relay,50:Pixhawk FMU AUX1,51:Pixhawk FMU AUX2,52:Pixhawk FMU AUX3,53:Pixhawk FMU AUX4,54:Pixhawk FMU AUX5,55:Pixhawk FMU AUX6,111:PX4 FMU Relay1,112:PX4 FMU Relay2,113:PX4IO Relay1,114:PX4IO Relay2,115:PX4IO ACC1,116:PX4IO ACC2 AP_GROUPINFO("PIN2", 1, AP_Relay, _pin[1], -1), +#if AP_RELAY_NUM_RELAYS > 2 // @Param: PIN3 // @DisplayName: Third Relay Pin // @Description: Digital pin number for 3rd relay control. // @User: Standard // @Values: -1:Disabled,13:APM2 A9 pin,47:APM1 relay,50:Pixhawk FMU AUX1,51:Pixhawk FMU AUX2,52:Pixhawk FMU AUX3,53:Pixhawk FMU AUX4,54:Pixhawk FMU AUX5,55:Pixhawk FMU AUX6,111:PX4 FMU Relay1,112:PX4 FMU Relay2,113:PX4IO Relay1,114:PX4IO Relay2,115:PX4IO ACC1,116:PX4IO ACC2 AP_GROUPINFO("PIN3", 2, AP_Relay, _pin[2], -1), +#endif +#if AP_RELAY_NUM_RELAYS > 3 // @Param: PIN4 // @DisplayName: Fourth Relay Pin // @Description: Digital pin number for 4th relay control. // @User: Standard // @Values: -1:Disabled,13:APM2 A9 pin,47:APM1 relay,50:Pixhawk FMU AUX1,51:Pixhawk FMU AUX2,52:Pixhawk FMU AUX3,53:Pixhawk FMU AUX4,54:Pixhawk FMU AUX5,55:Pixhawk FMU AUX6,111:PX4 FMU Relay1,112:PX4 FMU Relay2,113:PX4IO Relay1,114:PX4IO Relay2,115:PX4IO ACC1,116:PX4IO ACC2 AP_GROUPINFO("PIN4", 3, AP_Relay, _pin[3], -1), +#endif AP_GROUPEND }; diff --git a/libraries/AP_Relay/AP_Relay.h b/libraries/AP_Relay/AP_Relay.h index 2aa9a441c5..fc7b3c6eac 100644 --- a/libraries/AP_Relay/AP_Relay.h +++ b/libraries/AP_Relay/AP_Relay.h @@ -15,7 +15,7 @@ #include -#define AP_RELAY_NUM_RELAYS 4 +#define AP_RELAY_NUM_RELAYS 2 /// @class AP_Relay /// @brief Class to manage the APM relay