Skip to content

Commit

Permalink
only try to send buffer if size > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Jun 13, 2024
1 parent 2ca6b66 commit 856ea88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/sensors/core/tasks/pressure_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ class MMR920 {
}

void send_accumulated_sensor_data(uint32_t message_index) {
if (SENSOR_BUFFER_SIZE == 0) {
return;
}
for (size_t i = 0; i < SENSOR_BUFFER_SIZE; i++) {
// send over buffer and then clear buffer values
int current_index = (i + sensor_buffer_index) % SENSOR_BUFFER_SIZE;
Expand Down

0 comments on commit 856ea88

Please sign in to comment.