mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-01 13:38:38 -04:00
AP_Button: pre-arm displays gpio vs servo_ch conflict
This commit is contained in:
parent
f3db67b322
commit
1444545b6a
@ -380,7 +380,12 @@ bool AP_Button::arming_checks(size_t buflen, char *buffer) const
|
||||
}
|
||||
for (uint8_t i=0; i<AP_BUTTON_NUM_PINS; i++) {
|
||||
if (pin[i] != -1 && !hal.gpio->valid_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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user