Telemetry: make it possible to use UART2 on APM2

building with TELEMETRY_UART2=ENABLED allows you to use the solder
bridge on the APM2 to enable telemetry on UART2. This allows both USB
telemetry and a radio at the same time.
This commit is contained in:
Andrew Tridgell 2012-05-04 10:39:44 +10:00
parent a0b3966f09
commit 78d273fa34
4 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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