mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
321fc717ab
31 changed files with 1982 additions and 1717 deletions
|
@ -92,6 +92,7 @@ uint16_t cycleTime = 0; // this is the number in micro second to achieve
|
|||
int16_t headFreeModeHold;
|
||||
|
||||
int16_t telemTemperature1; // gyro sensor temperature
|
||||
static uint32_t disarmAt; // Time of automatic disarm when "Don't spin the motors when armed" is enabled and auto_disarm_delay is nonzero
|
||||
|
||||
extern uint8_t dynP8[3], dynI8[3], dynD8[3];
|
||||
extern failsafe_t *failsafe;
|
||||
|
@ -346,6 +347,8 @@ void mwArm(void)
|
|||
startBlackbox();
|
||||
}
|
||||
#endif
|
||||
disarmAt = millis() + masterConfig.auto_disarm_delay * 1000; // start disarm timeout, will be extended when throttle is nonzero
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -513,6 +516,21 @@ void processRx(void)
|
|||
resetErrorAngle();
|
||||
resetErrorGyro();
|
||||
}
|
||||
// When armed and motors aren't spinning, disarm board after delay so users without buzzer won't lose fingers.
|
||||
// mixTable constrains motor commands, so checking throttleStatus is enough
|
||||
if (
|
||||
ARMING_FLAG(ARMED)
|
||||
&& feature(FEATURE_MOTOR_STOP) && !STATE(FIXED_WING)
|
||||
&& masterConfig.auto_disarm_delay != 0
|
||||
&& isUsingSticksForArming()
|
||||
) {
|
||||
if (throttleStatus == THROTTLE_LOW) {
|
||||
if ((int32_t)(disarmAt - millis()) < 0) // delay is over
|
||||
mwDisarm();
|
||||
} else {
|
||||
disarmAt = millis() + masterConfig.auto_disarm_delay * 1000; // extend delay
|
||||
}
|
||||
}
|
||||
|
||||
processRcStickPositions(&masterConfig.rxConfig, throttleStatus, masterConfig.retarded_arm, masterConfig.disarm_kill_switch);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue