diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index ebc438930e..d3766185b2 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -202,7 +202,7 @@ private: GCS_Rover &gcs() { return _gcs; } // relay support - AP_Relay relay; + AP_Relay relay = AP_Relay::create(); AP_ServoRelayEvents ServoRelayEvents; diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index c1b6e56411..5542e121e0 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -536,7 +536,7 @@ private: uint8_t auto_trim_counter; // Reference to the relay object - AP_Relay relay; + AP_Relay relay = AP_Relay::create(); // handle repeated servo and relay events AP_ServoRelayEvents ServoRelayEvents; diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 268dfb06b7..5c14b3324c 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -267,7 +267,7 @@ private: AP_SpdHgtControl *SpdHgt_Controller = &TECS_controller; // Relay - AP_Relay relay; + AP_Relay relay = AP_Relay::create(); // handle servo and relay events AP_ServoRelayEvents ServoRelayEvents {relay}; diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index ccb26328f7..cdf45cc215 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -408,7 +408,7 @@ private: uint16_t mainLoop_count; // Reference to the relay object - AP_Relay relay; + AP_Relay relay = AP_Relay::create(); // handle repeated servo and relay events AP_ServoRelayEvents ServoRelayEvents; diff --git a/libraries/AP_Parachute/examples/AP_Parachute_test/AP_Parachute_test.cpp b/libraries/AP_Parachute/examples/AP_Parachute_test/AP_Parachute_test.cpp index bdf370078e..a3789452f8 100644 --- a/libraries/AP_Parachute/examples/AP_Parachute_test/AP_Parachute_test.cpp +++ b/libraries/AP_Parachute/examples/AP_Parachute_test/AP_Parachute_test.cpp @@ -19,7 +19,7 @@ void loop(); const AP_HAL::HAL& hal = AP_HAL::get_HAL(); // Relay -AP_Relay relay; +static AP_Relay relay = AP_Relay::create(); // Parachute AP_Parachute parachute(relay);