Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into EXEC-343-lld-cap-prob…
Browse files Browse the repository at this point in the history
…e-logging
  • Loading branch information
ryanthecoder committed Jun 4, 2024
2 parents c19f5e2 + 83f8f09 commit 806685e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/sensors/core/tasks/pressure_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,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 {
Expand All @@ -360,11 +360,10 @@ class MMR920 {

if (echo_this_time) {
#ifdef USE_SENSOR_MOVE
// send a response with 9999 to make an overload of the buffer
// visible
if (sensor_buffer_index < SENSOR_BUFFER_SIZE) {
(*p_buff).at(sensor_buffer_index) = pressure;
sensor_buffer_index++;
auto response_pressure = pressure - current_pressure_baseline_pa;
if (pressure_buffer_index < PRESSURE_SENSOR_BUFFER_SIZE) {
(*p_buff).at(pressure_buffer_index) = response_pressure;
pressure_buffer_index++;
}
#else
can_client.send_can_message(
Expand All @@ -373,7 +372,8 @@ class MMR920 {
.message_index = m.message_index,
.sensor = can::ids::SensorType::pressure,
.sensor_id = sensor_id,
.sensor_data = mmr920::reading_to_fixed_point(pressure)});
.sensor_data =
mmr920::reading_to_fixed_point(response_pressure)});
#endif
}
}
Expand Down

0 comments on commit 806685e

Please sign in to comment.