mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
BMP581: Collect data using normal mode (#24464)
This commit is contained in:
parent
ed0c8eff7b
commit
47ab0663f6
@ -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;
|
||||
|
||||
@ -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};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user