From 4b8b0f834db1888b71d79758c553405ceb6462c4 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Sat, 10 Jul 2021 23:47:27 +0530 Subject: [PATCH] AP_HAL: add support for usb passthrough with baud changes --- libraries/AP_HAL/UARTDriver.h | 5 +++++ libraries/AP_HAL/Util.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/AP_HAL/UARTDriver.h b/libraries/AP_HAL/UARTDriver.h index 909e0ec33d..a0befb1e99 100644 --- a/libraries/AP_HAL/UARTDriver.h +++ b/libraries/AP_HAL/UARTDriver.h @@ -17,6 +17,8 @@ public: // begin() implicitly clears rx/tx buffers, even if the port was already open (unless the UART is the console UART) virtual void begin(uint32_t baud) = 0; + virtual void begin_locked(uint32_t baud, uint32_t key) { begin(baud); } + /// Extended port open method /// /// Allows for both opening with specified buffer sizes, and re-opening @@ -137,4 +139,7 @@ public: */ virtual bool set_RTS_pin(bool high) { return false; }; virtual bool set_CTS_pin(bool high) { return false; }; + + // return true requested baud on USB port + virtual uint32_t get_usb_baud(void) const { return 0; } }; diff --git a/libraries/AP_HAL/Util.h b/libraries/AP_HAL/Util.h index 87784fa2e8..73e3ed55f9 100644 --- a/libraries/AP_HAL/Util.h +++ b/libraries/AP_HAL/Util.h @@ -100,11 +100,6 @@ public: */ virtual uint64_t get_hw_rtc() const; - /* - get the requested usb baudrate - 0 = none - */ - virtual uint32_t get_usb_baud(uint16_t endpoint_id) { return 0; } - enum class FlashBootloader { OK=0, NO_CHANGE=1,