1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

SONAR: Don't enable SENSOR_SONAR if no sonar is detected (#303)

This commit is contained in:
Konstantin Sharlaimov 2016-06-21 08:17:35 +10:00 committed by GitHub
parent 23b08bd6c5
commit 1cafd0d9e7

View file

@ -752,7 +752,11 @@ static rangefinderType_e detectRangefinder(void)
}
#endif
detectedSensors[SENSOR_INDEX_RANGEFINDER] = rangefinderType;
sensorsSet(SENSOR_SONAR);
if (rangefinderType != RANGEFINDER_NONE) {
sensorsSet(SENSOR_SONAR);
}
return rangefinderType;
}
#endif