AP_Compass: use a set_and_notify for external and IDs

ensure that GCS that connects quickly gets the right value
fixes issue #5364
This commit is contained in:
Andrew Tridgell 2016-12-10 08:16:17 +11:00 committed by Lucas De Marchi
parent eaa68f32e3
commit a440ac4c9d

View File

@ -106,7 +106,7 @@ uint8_t AP_Compass_Backend::register_compass(void) const
*/
void AP_Compass_Backend::set_dev_id(uint8_t instance, uint32_t dev_id)
{
_compass._state[instance].dev_id.set(dev_id);
_compass._state[instance].dev_id.set_and_notify(dev_id);
}
/*
@ -115,7 +115,7 @@ void AP_Compass_Backend::set_dev_id(uint8_t instance, uint32_t dev_id)
void AP_Compass_Backend::set_external(uint8_t instance, bool external)
{
if (_compass._state[instance].external != 2) {
_compass._state[instance].external.set(external);
_compass._state[instance].external.set_and_notify(external);
}
}