Plane: Don't log SONR if there are no rangefinders

This commit is contained in:
Michael du Breuil 2017-10-10 23:50:16 -07:00 committed by Tom Pittenger
parent dbf67aa38a
commit cc55e5a8fa
1 changed files with 2 additions and 1 deletions

View File

@ -46,8 +46,9 @@ void Plane::read_rangefinder(void)
rangefinder.update();
if (should_log(MASK_LOG_SONAR))
if ((rangefinder.num_sensors() > 0) && should_log(MASK_LOG_SONAR)) {
Log_Write_Sonar();
}
rangefinder_height_update();
}