From 40552568783446bc495c640b1baad029856418fc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 16 Jun 2018 08:46:31 +1000 Subject: [PATCH] AP_Arming: cache AP_HAL_millis --- libraries/AP_Arming/AP_Arming.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 51dd0eac44..e63045450e 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -176,6 +176,7 @@ bool AP_Arming::ins_accels_consistent(const AP_InertialSensor &ins) } const Vector3f &prime_accel_vec = ins.get_accel(); + const uint32_t now = AP_HAL::millis(); for(uint8_t i=0; i 10000) { + if (now - last_accel_pass_ms[i] > 10000) { return false; } } @@ -215,6 +216,7 @@ bool AP_Arming::ins_gyros_consistent(const AP_InertialSensor &ins) } const Vector3f &prime_gyro_vec = ins.get_gyro(); + const uint32_t now = AP_HAL::millis(); for(uint8_t i=0; i 10000) { + if (now - last_gyro_pass_ms[i] > 10000) { return false; } }