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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 14 deletions

View File

@ -97,31 +97,24 @@ void BMP581::print_status()
void BMP581::start()
{
_collect_phase = false;
measure();
ScheduleOnInterval(_measure_interval, _measure_interval * 3);
}
void BMP581::RunImpl()
{
if (_collect_phase) {
collect();
}
measure();
collect();
}
int BMP581::measure()
{
int ret;
_collect_phase = true;
perf_begin(_measure_perf);
/* start measurement */
ret = set_power_mode(BMP5_POWERMODE_FORCED);
ret = set_power_mode(BMP5_POWERMODE_NORMAL);
if (ret != PX4_OK) {
PX4_DEBUG("failed to set power mode");
@ -137,8 +130,6 @@ int BMP581::measure()
int BMP581::collect()
{
_collect_phase = false;
bmp5_sensor_data data{};
uint8_t int_status;

View File

@ -287,8 +287,6 @@ private:
perf_counter_t _measure_perf;
perf_counter_t _comms_errors;
bool _collect_phase{false};
uint8_t _chip_id{0};
uint8_t _chip_rev_id{0};