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