BMP581: Collect data using normal mode (#24464)

This commit is contained in:
Liu1
2025-04-08 03:48:23 +08:00
committed by GitHub
parent ed0c8eff7b
commit 47ab0663f6
2 changed files with 3 additions and 14 deletions
+3 -12
View File
@@ -97,31 +97,24 @@ void BMP581::print_status()
void BMP581::start() void BMP581::start()
{ {
_collect_phase = false; measure();
ScheduleOnInterval(_measure_interval, _measure_interval * 3); ScheduleOnInterval(_measure_interval, _measure_interval * 3);
} }
void BMP581::RunImpl() void BMP581::RunImpl()
{ {
collect();
if (_collect_phase) {
collect();
}
measure();
} }
int BMP581::measure() int BMP581::measure()
{ {
int ret; int ret;
_collect_phase = true;
perf_begin(_measure_perf); perf_begin(_measure_perf);
/* start measurement */ /* start measurement */
ret = set_power_mode(BMP5_POWERMODE_FORCED); ret = set_power_mode(BMP5_POWERMODE_NORMAL);
if (ret != PX4_OK) { if (ret != PX4_OK) {
PX4_DEBUG("failed to set power mode"); PX4_DEBUG("failed to set power mode");
@@ -137,8 +130,6 @@ int BMP581::measure()
int BMP581::collect() int BMP581::collect()
{ {
_collect_phase = false;
bmp5_sensor_data data{}; bmp5_sensor_data data{};
uint8_t int_status; uint8_t int_status;
-2
View File
@@ -287,8 +287,6 @@ private:
perf_counter_t _measure_perf; perf_counter_t _measure_perf;
perf_counter_t _comms_errors; perf_counter_t _comms_errors;
bool _collect_phase{false};
uint8_t _chip_id{0}; uint8_t _chip_id{0};
uint8_t _chip_rev_id{0}; uint8_t _chip_rev_id{0};