mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 01:18:29 -04:00
Sub: Ignore input hold button if disarmed
This commit is contained in:
parent
69be1725b6
commit
4e1c7fff37
@ -295,6 +295,9 @@ void Sub::handle_jsbutton_press(uint8_t button, bool shift, bool held)
|
|||||||
pitchTrim = constrain_float(pitchTrim-10,-200,200);
|
pitchTrim = constrain_float(pitchTrim-10,-200,200);
|
||||||
break;
|
break;
|
||||||
case JSButton::button_function_t::k_input_hold_set:
|
case JSButton::button_function_t::k_input_hold_set:
|
||||||
|
if(!motors.armed()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (!held) {
|
if (!held) {
|
||||||
zTrim = abs(z_last-500) > 50 ? z_last-500 : 0;
|
zTrim = abs(z_last-500) > 50 ? z_last-500 : 0;
|
||||||
xTrim = abs(x_last) > 50 ? x_last : 0;
|
xTrim = abs(x_last) > 50 ? x_last : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user