From 9c249161150d4ee0cd38cb69cbf4692e3d4ee43f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 18 Sep 2021 09:48:38 +1000 Subject: [PATCH] AP_HAL_SITL: move from HAL_NO_GCS to HAL_GCS_ENABLED --- libraries/AP_HAL_SITL/UARTDriver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_SITL/UARTDriver.cpp b/libraries/AP_HAL_SITL/UARTDriver.cpp index 83bac41e38..efaec830ee 100644 --- a/libraries/AP_HAL_SITL/UARTDriver.cpp +++ b/libraries/AP_HAL_SITL/UARTDriver.cpp @@ -39,7 +39,9 @@ #include "UARTDriver.h" #include "SITL_State.h" +#if HAL_GCS_ENABLED #include +#endif extern const AP_HAL::HAL& hal; @@ -474,7 +476,9 @@ void UARTDriver::_udp_start_client(const char *address, uint16_t port) } _is_udp = true; +#if HAL_GCS_ENABLED _packetise = true; +#endif _connected = true; } @@ -698,9 +702,11 @@ void UARTDriver::_timer_tick(void) if (_packetise) { uint16_t n = _writebuffer.available(); n = MIN(n, max_bytes); +#if HAL_GCS_ENABLED if (n > 0) { n = mavlink_packetise(_writebuffer, n); } +#endif if (n > 0) { // keep as a single UDP packet uint8_t tmpbuf[n];