From 076f7bc0cfd69c674341731f0544da83787f15d4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Dec 2017 12:06:14 +1100 Subject: [PATCH] AP_RSSI: removed create() method for objects See discussion here: https://github.com/ArduPilot/ardupilot/issues/7331 we were getting some uninitialised variables. While it only showed up in AP_SbusOut, it means we can't be sure it won't happen on other objects, so safest to remove the approach Thanks to assistance from Lucas, Peter and Francisco --- libraries/AP_RSSI/AP_RSSI.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libraries/AP_RSSI/AP_RSSI.h b/libraries/AP_RSSI/AP_RSSI.h index e0c84be51c..dc39250eac 100644 --- a/libraries/AP_RSSI/AP_RSSI.h +++ b/libraries/AP_RSSI/AP_RSSI.h @@ -28,9 +28,7 @@ public: RSSI_RECEIVER = 3 }; - static AP_RSSI create() { return AP_RSSI{}; } - - constexpr AP_RSSI(AP_RSSI &&other) = default; + AP_RSSI(); /* Do not allow copies */ AP_RSSI(const AP_RSSI &other) = delete; @@ -57,8 +55,6 @@ public: static const struct AP_Param::GroupInfo var_info[]; private: - AP_RSSI(); - // RSSI parameters AP_Int8 rssi_type; // Type of RSSI being used AP_Int8 rssi_analog_pin; // Analog pin RSSI value found on