Skip to content

Commit

Permalink
don't trigger before autobaseline is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Jun 25, 2024
1 parent bbb5df4 commit 3109317
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/sensors/core/tasks/pressure_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ class MMR920 {
hardware.reset_sync();
}
}
if (bind_sync) {
if (bind_sync &&
(sensor_buffer_index > AUTO_BASELINE_END || crossed_buffer_index)) {
if (std::fabs(pressure - current_pressure_baseline_pa -
current_moving_pressure_baseline_pa) >
threshold_pascals) {
hardware.set_sync();
// force this to stay set long enough to debounce on other nodes
} else {
hardware.reset_sync();
}
Expand Down

0 comments on commit 3109317

Please sign in to comment.