Plane: fixed build with HIL disabled

This commit is contained in:
Andrew Tridgell 2015-08-23 22:21:51 +10:00
parent a328a040fc
commit 695a266120
1 changed files with 5 additions and 1 deletions

View File

@ -178,7 +178,11 @@ void Plane::init_ardupilot()
airspeed.init();
if (g.compass_enabled==true) {
if (!compass.init() || (!g.hil_mode && !compass.read())) {
bool compass_ok = compass.init() && compass.read();
#if HIL_SUPPORT
compass_ok = true;
#endif
if (!compass_ok) {
cliSerial->println_P(PSTR("Compass initialisation failed!"));
g.compass_enabled = false;
} else {