mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 06:21:37 +08:00
drivers/differential_pressure move all to px4 work queue
This commit is contained in:
@@ -99,9 +99,9 @@ protected:
|
||||
* Perform a poll cycle; collect from the previous measurement
|
||||
* and start a new one.
|
||||
*/
|
||||
virtual void cycle();
|
||||
virtual int measure();
|
||||
virtual int collect();
|
||||
void Run() override;
|
||||
int measure() override;
|
||||
int collect() override;
|
||||
|
||||
math::LowPassFilter2p _filter{MEAS_RATE, MEAS_DRIVER_FILTER_FREQ};
|
||||
|
||||
@@ -238,7 +238,7 @@ MEASAirspeed::collect()
|
||||
}
|
||||
|
||||
void
|
||||
MEASAirspeed::cycle()
|
||||
MEASAirspeed::Run()
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -261,14 +261,10 @@ MEASAirspeed::cycle()
|
||||
/*
|
||||
* Is there a collect->measure gap?
|
||||
*/
|
||||
if (_measure_ticks > USEC2TICK(CONVERSION_INTERVAL)) {
|
||||
if (_measure_interval > CONVERSION_INTERVAL) {
|
||||
|
||||
/* schedule a fresh cycle call when we are ready to measure again */
|
||||
work_queue(HPWORK,
|
||||
&_work,
|
||||
(worker_t)&Airspeed::cycle_trampoline,
|
||||
this,
|
||||
_measure_ticks - USEC2TICK(CONVERSION_INTERVAL));
|
||||
ScheduleDelayed(_measure_interval - CONVERSION_INTERVAL);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -287,11 +283,7 @@ MEASAirspeed::cycle()
|
||||
_collect_phase = true;
|
||||
|
||||
/* schedule a fresh cycle call when the measurement is done */
|
||||
work_queue(HPWORK,
|
||||
&_work,
|
||||
(worker_t)&Airspeed::cycle_trampoline,
|
||||
this,
|
||||
USEC2TICK(CONVERSION_INTERVAL));
|
||||
ScheduleDelayed(CONVERSION_INTERVAL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user