forked from Archive/PX4-Autopilot
Add check_params(true) call to the LandDetector start() method. Break out _update_total_flight_time() method in the LandDetector class.
This commit is contained in:
parent
f783982edb
commit
d7cfebe0a3
|
@ -71,6 +71,7 @@ LandDetector::~LandDetector()
|
|||
|
||||
void LandDetector::start()
|
||||
{
|
||||
_check_params(true);
|
||||
ScheduleOnInterval(LAND_DETECTOR_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
|
@ -154,8 +155,7 @@ void LandDetector::_check_params(const bool force)
|
|||
|
||||
if (_param_update_sub.update(¶m_update) || force) {
|
||||
_update_params();
|
||||
_total_flight_time = static_cast<uint64_t>(_param_total_flight_time_high.get()) << 32;
|
||||
_total_flight_time |= _param_total_flight_time_low.get();
|
||||
_update_total_flight_time();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,4 +187,10 @@ void LandDetector::_update_state()
|
|||
}
|
||||
}
|
||||
|
||||
void LandDetector::_update_total_flight_time()
|
||||
{
|
||||
_total_flight_time = static_cast<uint64_t>(_param_total_flight_time_high.get()) << 32;
|
||||
_total_flight_time |= _param_total_flight_time_low.get();
|
||||
}
|
||||
|
||||
} // namespace land_detector
|
||||
|
|
|
@ -163,6 +163,8 @@ private:
|
|||
|
||||
void _update_state();
|
||||
|
||||
void _update_total_flight_time();
|
||||
|
||||
bool _previous_armed_state{false}; ///< stores the previous actuator_armed.armed state
|
||||
|
||||
uint64_t _total_flight_time{0}; ///< in microseconds
|
||||
|
|
Loading…
Reference in New Issue