Commit 1cafd0d9 authored by Konstantin Sharlaimov's avatar Konstantin Sharlaimov Committed by GitHub
Browse files

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

parent 23b08bd6
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment