From 032bfad79f125049b40f37a400444e723fff587b Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 15 Apr 2017 09:46:25 +0900 Subject: [PATCH] Copter: move rc input check to esc_calibration_startup_check No functional change --- ArduCopter/esc_calibration.cpp | 7 +++++++ ArduCopter/radio.cpp | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ArduCopter/esc_calibration.cpp b/ArduCopter/esc_calibration.cpp index 9eaeaaf114..0c96cac7eb 100644 --- a/ArduCopter/esc_calibration.cpp +++ b/ArduCopter/esc_calibration.cpp @@ -19,6 +19,13 @@ enum ESCCalibrationModes { void Copter::esc_calibration_startup_check() { #if FRAME_CONFIG != HELI_FRAME + // delay up to 2 second for first radio input + uint8_t i = 0; + while ((i++ < 100) && (last_radio_update_ms == 0)) { + delay(20); + read_radio(); + } + // exit immediately if pre-arm rc checks fail arming.pre_arm_rc_checks(true); if (!ap.pre_arm_rc_check) { diff --git a/ArduCopter/radio.cpp b/ArduCopter/radio.cpp index e87b076016..1054e3b8d4 100644 --- a/ArduCopter/radio.cpp +++ b/ArduCopter/radio.cpp @@ -59,13 +59,6 @@ void Copter::init_rc_out() hal.rcout->set_esc_scaling(channel_throttle->get_radio_min(), channel_throttle->get_radio_max()); #endif - // delay up to 2 second for first radio input - uint8_t i = 0; - while ((i++ < 100) && (last_radio_update_ms == 0)) { - delay(20); - read_radio(); - } - // check if we should enter esc calibration mode esc_calibration_startup_check();