diff --git a/libraries/AP_Button/AP_Button.cpp b/libraries/AP_Button/AP_Button.cpp index 449146adec..6fb4e58e98 100644 --- a/libraries/AP_Button/AP_Button.cpp +++ b/libraries/AP_Button/AP_Button.cpp @@ -388,7 +388,12 @@ bool AP_Button::arming_checks(size_t buflen, char *buffer) const } for (uint8_t i=0; ivalid_pin(pin[i])) { - hal.util->snprintf(buffer, buflen, "BTN_PIN%u %d invalid", unsigned(i + 1), int(pin[i].get())); + uint8_t servo_ch; + if (hal.gpio->pin_to_servo_channel(pin[i], servo_ch)) { + hal.util->snprintf(buffer, buflen, "BTN_PIN%u=%d, set SERVO%u_FUNCTION=-1", unsigned(i + 1), int(pin[i].get()), unsigned(servo_ch+1)); + } else { + hal.util->snprintf(buffer, buflen, "BTN_PIN%u=%d invalid", unsigned(i + 1), int(pin[i].get())); + } return false; } }