diff --git a/libraries/AP_HAL/UARTDriver.h b/libraries/AP_HAL/UARTDriver.h index a7e0c61ef2..d876de6a93 100644 --- a/libraries/AP_HAL/UARTDriver.h +++ b/libraries/AP_HAL/UARTDriver.h @@ -178,6 +178,13 @@ public: } #endif + /* + return true if the port is currently locked for writing + */ + bool is_write_locked(void) const { + return lock_write_key != 0; + } + protected: // key for a locked port uint32_t lock_write_key;