mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
BMP581: Collect data using normal mode (#24464)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user