AP_HAL_SITL: permit float-equal while we do comparison vs INFINITY
This commit is contained in:
parent
1f1c3796c1
commit
2f77fef10e
@ -32,9 +32,12 @@ float SITL_State::_sonar_pin_voltage() const
|
||||
}
|
||||
|
||||
const float altitude = sitl_model->rangefinder_range();
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
if (altitude == INFINITY) {
|
||||
return 5.0f;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// Altitude in in m, scaler in meters/volt
|
||||
const float voltage = altitude / _sitl->sonar_scale;
|
||||
|
Loading…
Reference in New Issue
Block a user