Browse Source

Copter: ensure esc calibration only occurs on next reboot

It was possible for a board with no safety switch attached to get stuck waiting for the user to press the non-existance switch.  Rebooting now resolves the problem because the ESC_CAL parameter is reset to zero regardless of whether the calibration completes or not.
mission-4.1.18
Randy Mackay 8 years ago
parent
commit
f9c8bb1b01
  1. 6
      ArduCopter/esc_calibration.cpp

6
ArduCopter/esc_calibration.cpp

@ -125,6 +125,9 @@ void Copter::esc_calibration_auto() @@ -125,6 +125,9 @@ void Copter::esc_calibration_auto()
#if FRAME_CONFIG != HELI_FRAME
bool printed_msg = false;
// clear esc flag for next time
g.esc_calibrate.set_and_save(ESCCAL_NONE);
if (motors->get_pwm_type() >= AP_Motors::PWM_TYPE_ONESHOT) {
// run at full speed for oneshot ESCs (actually done on push)
motors->set_update_rate(g.rc_speed);
@ -169,9 +172,6 @@ void Copter::esc_calibration_auto() @@ -169,9 +172,6 @@ void Copter::esc_calibration_auto()
// reduce throttle to minimum
motors->set_throttle_passthrough_for_esc_calibration(0.0f);
// clear esc parameter
g.esc_calibrate.set_and_save(ESCCAL_NONE);
// block until we restart
while(1) {
motors->set_throttle_passthrough_for_esc_calibration(0.0f);

Loading…
Cancel
Save