Skip to content

Commit

Permalink
AP_Arming: Determine the channel's MIN and MAX values as intermediate…
Browse files Browse the repository at this point in the history
… values
  • Loading branch information
muramura committed Apr 19, 2023
1 parent cf20a70 commit f426093
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libraries/AP_Arming/AP_Arming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,17 @@ bool AP_Arming::rc_calibration_checks(bool report)
check_failed(ARMING_CHECK_RC, report, "RC%d_MAX is less than RC%d_TRIM", i + 1, i + 1);
check_passed = false;
}

// Expect the width of the channel to be above and below the center plus and minus 200 PMM
uint16_t center = c->get_radio_max() - c->get_radio_min() / 2;
if (c->get_radio_min() > center) {
check_failed(ARMING_CHECK_RC, report, "RC%d_MIN is greater than %d %d", i + 1, center);
check_passed = false;
}
if (c->get_radio_max() < center) {
check_failed(ARMING_CHECK_RC, report, "RC%d_MAX is less than %d %d", i + 1, center);
check_passed = false;
}
}

return check_passed;
Expand Down

0 comments on commit f426093

Please sign in to comment.