Skip to content

Commit

Permalink
accelerometer: Initialize the message variable
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Aug 16, 2024
1 parent 79a8ff2 commit 0f64d07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/drivers/accelerometer/PX4Accelerometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void PX4Accelerometer::update(const hrt_abstime &timestamp_sample, float x, floa
rotate_3f(_rotation, x, y, z);

// publish
sensor_accel_s report;
sensor_accel_s report{};

report.timestamp_sample = timestamp_sample;
report.device_id = _device_id;
Expand Down Expand Up @@ -151,7 +151,7 @@ void PX4Accelerometer::updateFIFO(sensor_accel_fifo_s &sample)


// publish
sensor_accel_s report;
sensor_accel_s report{};
report.timestamp_sample = sample.timestamp_sample;
report.device_id = _device_id;
report.temperature = _temperature;
Expand Down

0 comments on commit 0f64d07

Please sign in to comment.