From a07b238c7d8a1478dc2cb1c641bfcf7ab941c2b7 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 5 Dec 2020 19:16:05 +0000 Subject: [PATCH] AP_HAL: add PRIORITY_RCOUT don't allow UART copies add @SYS/uarts.txt --- libraries/AP_HAL/Scheduler.h | 1 + libraries/AP_HAL/UARTDriver.h | 4 ++++ libraries/AP_HAL/Util.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/libraries/AP_HAL/Scheduler.h b/libraries/AP_HAL/Scheduler.h index f70af85e09..2a82050dae 100644 --- a/libraries/AP_HAL/Scheduler.h +++ b/libraries/AP_HAL/Scheduler.h @@ -108,6 +108,7 @@ public: PRIORITY_I2C, PRIORITY_CAN, PRIORITY_TIMER, + PRIORITY_RCOUT, PRIORITY_RCIN, PRIORITY_IO, PRIORITY_UART, diff --git a/libraries/AP_HAL/UARTDriver.h b/libraries/AP_HAL/UARTDriver.h index 254e0d7229..10cd37a648 100644 --- a/libraries/AP_HAL/UARTDriver.h +++ b/libraries/AP_HAL/UARTDriver.h @@ -9,6 +9,10 @@ class AP_HAL::UARTDriver : public AP_HAL::BetterStream { public: UARTDriver() {} + /* Do not allow copies */ + UARTDriver(const UARTDriver &other) = delete; + UARTDriver &operator=(const UARTDriver&) = delete; + // 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; /// Extended port open method diff --git a/libraries/AP_HAL/Util.h b/libraries/AP_HAL/Util.h index 4eef24dd70..5a107f7409 100644 --- a/libraries/AP_HAL/Util.h +++ b/libraries/AP_HAL/Util.h @@ -196,6 +196,9 @@ public: // load persistent parameters from bootloader sector virtual bool load_persistent_params(ExpandingString &str) const { return false; } + // request information on uart I/O + virtual void uart_info(ExpandingString &str) {} + protected: // we start soft_armed false, so that actuators don't send any // values until the vehicle code has fully started