From 7dd2529683d7757bc403bf151ffd14902fe94784 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 6 Apr 2024 17:07:19 +0100 Subject: [PATCH] AP_HAL_ChibiOS: UARTDriver: add getters for cumulative tx and rx counts --- libraries/AP_HAL_ChibiOS/UARTDriver.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.h b/libraries/AP_HAL_ChibiOS/UARTDriver.h index 3c49965a96..b28091e053 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.h +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.h @@ -274,6 +274,12 @@ protected: ssize_t _read(uint8_t *buffer, uint16_t count) override; uint32_t _available() override; bool _discard_input() override; + +#if HAL_UART_STATS_ENABLED + // Getters for cumulative tx and rx counts + uint32_t get_total_tx_bytes() const override { return _tx_stats_bytes; } + uint32_t get_total_rx_bytes() const override { return _rx_stats_bytes; } +#endif }; // access to usb init for stdio.cpp