mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_Vehicle: correct update_dynamic_notch_at_specified_rate()
This commit is contained in:
parent
187a12103c
commit
de27e2ce25
@ -340,12 +340,17 @@ void AP_Vehicle::write_notch_log_messages() const
|
||||
// run notch update at either loop rate or 200Hz
|
||||
void AP_Vehicle::update_dynamic_notch_at_specified_rate()
|
||||
{
|
||||
if (ins.has_harmonic_option(HarmonicNotchFilterParams::Options::LoopRateUpdate)) {
|
||||
update_dynamic_notch();
|
||||
return;
|
||||
}
|
||||
|
||||
// decimated update at 200Hz
|
||||
const uint32_t now = AP_HAL::millis();
|
||||
|
||||
if (ins.has_harmonic_option(HarmonicNotchFilterParams::Options::LoopRateUpdate)
|
||||
|| now - _last_notch_update_ms > 5) {
|
||||
update_dynamic_notch();
|
||||
if (now - _last_notch_update_ms > 5) {
|
||||
_last_notch_update_ms = now;
|
||||
update_dynamic_notch();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user