diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index fcf4af17bf4f152444315a572ce67f839d578158..3f3d7e3b98d91050ca34d72d689a69131eabfe4c 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -72,7 +72,12 @@ version 2.1 of the License, or (at your option) any later version. // FastSerialPort0(Serial); // FTDI/console FastSerialPort1(Serial1); // GPS port -FastSerialPort3(Serial3); // Telemetry port +#if TELEMETRY_UART2 == ENABLED + // solder bridge set to enable UART2 instead of USB MUX + FastSerialPort2(Serial3); +#else + FastSerialPort3(Serial3); // Telemetry port for APM1 +#endif //////////////////////////////////////////////////////////////////////////////// // ISR Registry diff --git a/ArduPlane/Makefile b/ArduPlane/Makefile index 8205e702f7205e3867dd5e9239755bda7e267daa..97c5443429ab1f4c0b2f626b77f8a181869a982b 100644 --- a/ArduPlane/Makefile +++ b/ArduPlane/Makefile @@ -21,6 +21,9 @@ heli: apm2: make -f Makefile EXTRAFLAGS="-DCONFIG_APM_HARDWARE=APM_HARDWARE_APM2" +apm2-uart2: + make -f Makefile EXTRAFLAGS="-DCONFIG_APM_HARDWARE=APM_HARDWARE_APM2 -DTELEMETRY_UART2=ENABLED" + apm2beta: make -f Makefile EXTRAFLAGS="-DCONFIG_APM_HARDWARE=APM_HARDWARE_APM2 -DAPM2_BETA_HARDWARE" diff --git a/ArduPlane/config.h b/ArduPlane/config.h index 79bbc69476f274644868f50b45c89d5656600d90..e387d4bb694747a98938e9be7dbe6d34c159c6aa 100644 --- a/ArduPlane/config.h +++ b/ArduPlane/config.h @@ -81,6 +81,12 @@ # endif #endif +// use this to enable telemetry on UART2. This is used +// when you have setup the solder bridge on an APM2 to enable UART2 +#ifndef TELEMETRY_UART2 +# define TELEMETRY_UART2 DISABLED +#endif + ////////////////////////////////////////////////////////////////////////////// // LED and IO Pins // @@ -105,7 +111,11 @@ # define SLIDE_SWITCH_PIN (-1) # define PUSHBUTTON_PIN (-1) # define CLI_SLIDER_ENABLED DISABLED +#if TELEMETRY_UART2 == ENABLED +# define USB_MUX_PIN -1 +#else # define USB_MUX_PIN 23 +#endif # define BATTERY_PIN_1 1 # define CURRENT_PIN_1 2 #endif diff --git a/ArduPlane/planner.pde b/ArduPlane/planner.pde index 86147133d44e2733f0a340d0b055aa87bbefc5e5..1a5d8ee4af12aec87eb6d0f002ccf85a059889a9 100644 --- a/ArduPlane/planner.pde +++ b/ArduPlane/planner.pde @@ -27,7 +27,7 @@ planner_gcs(uint8_t argc, const Menu::arg *argv) { gcs0.init(&Serial); -#if USB_MUX_PIN > 0 +#if USB_MUX_PIN < 0 // we don't have gcs3 if we have the USB mux setup gcs3.init(&Serial3); #endif