From cea57f51c1e748319de5f13db385a9821f711589 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 8 Jan 2022 21:56:52 +1100 Subject: [PATCH] AP_HAL_Empty: add HAL_UART_STATS_ENABLED to disable stats gathering --- libraries/AP_HAL_Empty/UARTDriver.cpp | 2 ++ libraries/AP_HAL_Empty/UARTDriver.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libraries/AP_HAL_Empty/UARTDriver.cpp b/libraries/AP_HAL_Empty/UARTDriver.cpp index ab12fca5ee..9241248a84 100644 --- a/libraries/AP_HAL_Empty/UARTDriver.cpp +++ b/libraries/AP_HAL_Empty/UARTDriver.cpp @@ -30,7 +30,9 @@ size_t Empty::UARTDriver::write(const uint8_t *buffer, size_t size) return n; } +#if HAL_UART_STATS_ENABLED void Empty::UARTDriver::uart_info(ExpandingString &str) { str.printf("EMPTY\n"); } +#endif diff --git a/libraries/AP_HAL_Empty/UARTDriver.h b/libraries/AP_HAL_Empty/UARTDriver.h index 65515bd3ff..8aad82b197 100644 --- a/libraries/AP_HAL_Empty/UARTDriver.h +++ b/libraries/AP_HAL_Empty/UARTDriver.h @@ -24,6 +24,8 @@ public: size_t write(uint8_t c) override; size_t write(const uint8_t *buffer, size_t size) override; +#if HAL_UART_STATS_ENABLED // request information on uart I/O for one uart void uart_info(ExpandingString &str) override; +#endif };