|
|
|
@ -150,13 +150,15 @@ static void init_ardupilot()
@@ -150,13 +150,15 @@ static void init_ardupilot()
|
|
|
|
|
// we have a 2nd serial port for telemetry on all boards except |
|
|
|
|
// APM2. We actually do have one on APM2 but it isn't necessary as |
|
|
|
|
// a MUX is used |
|
|
|
|
hal.uartC->begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, 128); |
|
|
|
|
hal.uartC->begin(map_baudrate(g.serial1_baud, SERIAL1_BAUD), 128, 128); |
|
|
|
|
gcs[1].init(hal.uartC); |
|
|
|
|
#endif |
|
|
|
|
#if MAVLINK_COMM_NUM_BUFFERS > 2 |
|
|
|
|
if (hal.uartD != NULL) { |
|
|
|
|
hal.uartD->begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, 128); |
|
|
|
|
hal.uartD->begin(map_baudrate(g.serial2_baud, SERIAL2_BAUD), 128, 128); |
|
|
|
|
gcs[2].init(hal.uartD); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// identify ourselves correctly with the ground station |
|
|
|
|
mavlink_system.sysid = g.sysid_this_mav; |
|
|
|
@ -529,7 +531,7 @@ static uint32_t map_baudrate(int8_t rate, uint32_t default_baud)
@@ -529,7 +531,7 @@ static uint32_t map_baudrate(int8_t rate, uint32_t default_baud)
|
|
|
|
|
case 111: return 111100; |
|
|
|
|
case 115: return 115200; |
|
|
|
|
} |
|
|
|
|
//cliSerial->println_P(PSTR("Invalid SERIAL3_BAUD")); |
|
|
|
|
//cliSerial->println_P(PSTR("Invalid baudrate")); |
|
|
|
|
return default_baud; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -547,11 +549,11 @@ static void check_usb_mux(void)
@@ -547,11 +549,11 @@ static void check_usb_mux(void)
|
|
|
|
|
// the APM2 has a MUX setup where the first serial port switches |
|
|
|
|
// between USB and a TTL serial connection. When on USB we use |
|
|
|
|
// SERIAL0_BAUD, but when connected as a TTL serial port we run it |
|
|
|
|
// at SERIAL3_BAUD. |
|
|
|
|
// at SERIAL1_BAUD. |
|
|
|
|
if (ap.usb_connected) { |
|
|
|
|
hal.uartA->begin(SERIAL0_BAUD); |
|
|
|
|
} else { |
|
|
|
|
hal.uartA->begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD)); |
|
|
|
|
hal.uartA->begin(map_baudrate(g.serial1_baud, SERIAL1_BAUD)); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|