Airspeed driver: Use the known sensor offset for raw value as well

This commit is contained in:
Lorenz Meier
2014-07-14 08:33:35 +02:00
parent 9ce7820e41
commit f3549d775c
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -225,7 +225,10 @@ MEASAirspeed::collect()
// correct for 5V rail voltage if possible
voltage_correction(diff_press_pa_raw, temperature);
float diff_press_pa = fabsf(diff_press_pa_raw - _diff_pres_offset);
// the raw value still should be compensated for the known offset
diff_press_pa_raw -= _diff_pres_offset;
float diff_press_pa = fabsf(diff_press_pa_raw);
/*
note that we return both the absolute value with offset