Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Arming: Determine the channel's MIN and MAX values as intermediate values #23552

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three %d but only two integer arguments. This variadic function call is missing an argument

check_passed = false;
}
if (c->get_radio_max() < center) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impossible to get to unless radio_min is 0 or 1.

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