AP_Periph: use AP::compass().available in place of enabled()

This commit is contained in:
Peter Barker 2021-07-28 10:39:38 +10:00 committed by Peter Barker
parent d5ea202c20
commit d40587062e
2 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ void AP_Periph_FW::init()
#endif
#ifdef HAL_PERIPH_ENABLE_MAG
if (compass.enabled()) {
if (compass.available()) {
compass.init();
}
#endif

View File

@ -1480,7 +1480,7 @@ void AP_Periph_FW::can_update()
void AP_Periph_FW::can_mag_update(void)
{
#ifdef HAL_PERIPH_ENABLE_MAG
if (!compass.enabled()) {
if (!compass.available()) {
return;
}
compass.read();