From 457183b6f53bf9598be46c9cb633943feab8a099 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 23 Nov 2013 21:44:45 +1100 Subject: [PATCH] Plane: cope with uartD being NULL --- ArduPlane/system.pde | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArduPlane/system.pde b/ArduPlane/system.pde index 84df734854..21b3e28a30 100644 --- a/ArduPlane/system.pde +++ b/ArduPlane/system.pde @@ -120,7 +120,7 @@ static void init_ardupilot() 128, SERIAL2_BUFSIZE); gcs[1].init(hal.uartC); - if (num_gcs > 2) { + if (hal.uartD != NULL) { hal.uartD->begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, SERIAL2_BUFSIZE); gcs[2].init(hal.uartD); @@ -265,6 +265,9 @@ static void startup_ground(void) // ready to fly hal.uartA->set_blocking_writes(false); hal.uartC->set_blocking_writes(false); + if (hal.uartD != NULL) { + hal.uartD->set_blocking_writes(false); + } #if 0 // leave GPS blocking until we have support for correct handling