From c72c1de99e9a9222bc9766add640457ec98874d0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Dec 2017 12:06:13 +1100 Subject: [PATCH] AP_Module: 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_Module/examples/ModuleTest/ModuleTest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp b/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp index 8fca7e6b8c..fffad2d27f 100644 --- a/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp +++ b/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp @@ -13,13 +13,13 @@ void loop(); const AP_HAL::HAL& hal = AP_HAL::get_HAL(); // sensor declaration -static AP_InertialSensor ins = AP_InertialSensor::create(); -static AP_GPS gps = AP_GPS::create(); -static AP_Baro baro = AP_Baro::create(); -static AP_SerialManager serial_manager = AP_SerialManager::create(); +static AP_InertialSensor ins; +static AP_GPS gps; +static AP_Baro baro; +static AP_SerialManager serial_manager; // choose which AHRS system to use -static AP_AHRS_DCM ahrs = AP_AHRS_DCM::create(ins, baro, gps); +static AP_AHRS_DCM ahrs{ins, baro, gps}; void setup(void) {