mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 06:53:33 +08:00
esc_calibration: use hrt_elapsed_time instead of manually calculating the diff
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -161,7 +161,7 @@ int do_esc_calibration(orb_advert_t *mavlink_log_pub, struct actuator_armed_s* a
|
|||||||
// sit high.
|
// sit high.
|
||||||
hrt_abstime timeout_wait = batt_connected ? pwm_high_timeout : battery_connect_wait_timeout;
|
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) {
|
if (!batt_connected) {
|
||||||
calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, "Timeout waiting for battery");
|
calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, "Timeout waiting for battery");
|
||||||
goto Error;
|
goto Error;
|
||||||
|
|||||||
Reference in New Issue
Block a user