diff --git a/include/sensors/core/tasks/pressure_driver.hpp b/include/sensors/core/tasks/pressure_driver.hpp index 582dfdd87..f0872519b 100644 --- a/include/sensors/core/tasks/pressure_driver.hpp +++ b/include/sensors/core/tasks/pressure_driver.hpp @@ -355,7 +355,7 @@ class MMR920 { } } if (bind_sync) { - if (std::fabs(pressure) - std::fabs(current_pressure_baseline_pa) > + if (std::fabs(pressure - current_pressure_baseline_pa) > threshold_pascals) { hardware.set_sync(); } else { @@ -364,8 +364,7 @@ class MMR920 { } if (echo_this_time) { - auto response_pressure = (pressure < 0 ? -1 : 1) * ( - std::fabs(pressure) - std::fabs(current_pressure_baseline_pa)); + auto response_pressure = pressure - current_pressure_baseline_pa; #ifdef USE_PRESSURE_MOVE if (pressure_buffer_index < PRESSURE_SENSOR_BUFFER_SIZE) { (*p_buff).at(pressure_buffer_index) = response_pressure;