Add "calibrate esc" command

This commit is contained in:
Don Gagne 2015-05-22 09:28:52 -07:00
parent 9cf1b4ba7a
commit a6af1fc0fa
1 changed files with 5 additions and 8 deletions

View File

@ -326,6 +326,8 @@ int commander_main(int argc, char *argv[])
calib_ret = do_gyro_calibration(mavlink_fd);
} else if (!strcmp(argv[2], "level")) {
calib_ret = do_level_calibration(mavlink_fd);
} else if (!strcmp(argv[2], "esc")) {
calib_ret = do_esc_calibration(mavlink_fd, &armed);
} else {
warnx("argument %s unsupported.", argv[2]);
}
@ -2744,14 +2746,9 @@ void *commander_low_prio_loop(void *arg)
} else if ((int)(cmd.param7) == 1) {
/* do esc calibration */
calib_ret = check_if_batt_disconnected(mavlink_fd);
if(calib_ret == OK) {
answer_command(cmd,VEHICLE_CMD_RESULT_ACCEPTED);
armed.in_esc_calibration_mode = true;
calib_ret = do_esc_calibration(mavlink_fd);
armed.in_esc_calibration_mode = false;
}
answer_command(cmd,VEHICLE_CMD_RESULT_ACCEPTED);
calib_ret = do_esc_calibration(mavlink_fd, &armed);
} else if ((int)(cmd.param4) == 0) {
/* RC calibration ended - have we been in one worth confirming? */
if (status.rc_input_blocked) {