diff --git a/ArduPlane/control_modes.pde b/ArduPlane/control_modes.pde index 31fc315dec..6ce7dfbe85 100644 --- a/ArduPlane/control_modes.pde +++ b/ArduPlane/control_modes.pde @@ -40,6 +40,7 @@ static void reset_control_switch() static void update_servo_switches() { +#if CONFIG_APM_HARDWARE != APM_HARDWARE_PURPLE if (!g.switch_enable) { // switches are disabled in EEPROM (see SWITCH_ENABLE option) // this means the EEPROM control of all channel reversal is enabled @@ -57,4 +58,5 @@ static void update_servo_switches() g.reverse_ch1_elevon = (PINE & 64) ? true : false; g.reverse_ch2_elevon = (PINL & 64) ? true : false; } +#endif } diff --git a/ArduPlane/test.pde b/ArduPlane/test.pde index 5f0938a454..524a98bd30 100644 --- a/ArduPlane/test.pde +++ b/ArduPlane/test.pde @@ -25,7 +25,9 @@ static int8_t test_xbee(uint8_t argc, const Menu::arg *argv); static int8_t test_eedump(uint8_t argc, const Menu::arg *argv); static int8_t test_rawgps(uint8_t argc, const Menu::arg *argv); static int8_t test_modeswitch(uint8_t argc, const Menu::arg *argv); +#if CONFIG_APM_HARDWARE != APM_HARDWARE_PURPLE static int8_t test_dipswitches(uint8_t argc, const Menu::arg *argv); +#endif // Creates a constant array of structs representing menu options // and stores them in Flash memory, not RAM. @@ -42,7 +44,9 @@ static const struct Menu::command test_menu_commands[] PROGMEM = { {"xbee", test_xbee}, {"eedump", test_eedump}, {"modeswitch", test_modeswitch}, +#if CONFIG_APM_HARDWARE != APM_HARDWARE_PURPLE {"dipswitches", test_dipswitches}, +#endif // Tests below here are for hardware sensors only present // when real sensors are attached or they are emulated @@ -406,6 +410,7 @@ test_modeswitch(uint8_t argc, const Menu::arg *argv) } } +#if CONFIG_APM_HARDWARE != APM_HARDWARE_PURPLE static int8_t test_dipswitches(uint8_t argc, const Menu::arg *argv) { @@ -436,6 +441,8 @@ test_dipswitches(uint8_t argc, const Menu::arg *argv) } } } +#endif // CONFIG_APM_HARDWARE != APM_HARDWARE_PURPLE + //------------------------------------------------------------------------------------------- // tests in this section are for real sensors or sensors that have been simulated