mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
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:
parent
95f00b4891
commit
00ed6bbc2b
@ -103,7 +103,7 @@ uint8_t AP_Compass_Backend::register_compass(void) const
|
|||||||
*/
|
*/
|
||||||
void AP_Compass_Backend::set_dev_id(uint8_t instance, uint32_t dev_id)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -112,7 +112,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)
|
void AP_Compass_Backend::set_external(uint8_t instance, bool external)
|
||||||
{
|
{
|
||||||
if (_compass._state[instance].external != 2) {
|
if (_compass._state[instance].external != 2) {
|
||||||
_compass._state[instance].external.set(external);
|
_compass._state[instance].external.set_and_notify(external);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user