From 5d87eed41cc7efcab213757753d026794cc378f0 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 23 Apr 2018 16:43:22 +0200 Subject: [PATCH] esc_calibration: use hrt_elapsed_time instead of manually calculating the diff Signed-off-by: Roman --- src/modules/commander/esc_calibration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/commander/esc_calibration.cpp b/src/modules/commander/esc_calibration.cpp index 7fbeffd4e7..0f3f15049a 100644 --- a/src/modules/commander/esc_calibration.cpp +++ b/src/modules/commander/esc_calibration.cpp @@ -161,7 +161,7 @@ int do_esc_calibration(orb_advert_t *mavlink_log_pub, struct actuator_armed_s* a // sit high. hrt_abstime timeout_wait = batt_connected ? pwm_high_timeout : battery_connect_wait_timeout; - if (hrt_absolute_time() - timeout_start > timeout_wait) { + if (hrt_elapsed_time(&timeout_start) > timeout_wait) { if (!batt_connected) { calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, "Timeout waiting for battery"); goto Error;