From f46207499aee72b39bd8441ab22c56a66dae8e89 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 7 May 2019 11:59:14 +1000 Subject: [PATCH] Copter: prevent reset on compassmot due to watchdog --- ArduCopter/compassmot.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ArduCopter/compassmot.cpp b/ArduCopter/compassmot.cpp index 8e4850565d..e9d3913862 100644 --- a/ArduCopter/compassmot.cpp +++ b/ArduCopter/compassmot.cpp @@ -124,6 +124,8 @@ MAV_RESULT Copter::mavlink_compassmot(mavlink_channel_t chan) interference_pct[i] = 0.0f; } + hal.scheduler->expect_delay_ms(5000); + // enable motors and pass through throttle init_rc_out(); enable_motor_output(); @@ -135,6 +137,8 @@ MAV_RESULT Copter::mavlink_compassmot(mavlink_channel_t chan) // main run while there is no user input and the compass is healthy while (command_ack_start == command_ack_counter && compass.healthy() && motors->armed()) { + hal.scheduler->expect_delay_ms(5000); + // 50hz loop if (millis() - last_run_time < 20) { hal.scheduler->delay(5); @@ -226,6 +230,8 @@ MAV_RESULT Copter::mavlink_compassmot(mavlink_channel_t chan) } } + hal.scheduler->expect_delay_ms(0); + // stop motors motors->output_min(); motors->armed(false);