diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 5faee3f8c3..c42417af59 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -274,6 +274,7 @@ private: uint8_t land_repo_active : 1; // 22 // true if the pilot is overriding the landing position uint8_t motor_interlock_switch : 1; // 23 // true if pilot is requesting motor interlock enable uint8_t in_arming_delay : 1; // 24 // true while we are armed but waiting to spin motors + uint8_t initialised_params : 1; // 25 // true when the all parameters have been initialised. we cannot send parameters to the GCS until this is done }; uint32_t value; } ap; diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index a4de843ff0..42d2d51090 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -862,7 +862,7 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg) // if we have not yet initialised (including allocating the motors // object) we drop this request. That prevents the GCS from getting // a confusing parameter count during bootup - if (!copter.ap.initialised) { + if (!copter.ap.initialised_params) { break; } diff --git a/ArduCopter/system.cpp b/ArduCopter/system.cpp index c87ac07771..acc2edc332 100644 --- a/ArduCopter/system.cpp +++ b/ArduCopter/system.cpp @@ -184,7 +184,11 @@ void Copter::init_ardupilot() // allocate the motors class allocate_motors(); - init_rc_out(); // sets up motors and output to escs + // sets up motors and output to escs + init_rc_out(); + + // motors initialised so parameters can be sent + ap.initialised_params = true; // initialise which outputs Servo and Relay events can use ServoRelayEvents.set_channel_mask(~motors->get_motor_mask());