Browse Source

Avoid calling mwDisarm() when due to having auto_disarm_delay when using

switch to arm().
master
Dominic Clifton 10 years ago
parent
commit
347b156727
  1. 5
      src/main/io/rc_controls.c
  2. 1
      src/main/io/rc_controls.h
  3. 7
      src/main/mw.c

5
src/main/io/rc_controls.c

@ -57,6 +57,11 @@ int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+
uint32_t rcModeActivationMask; // one bit per mode defined in boxId_e
bool isUsingSticksForArming(void)
{
return isUsingSticksToArm;
}
bool areSticksInApModePosition(uint16_t ap_mode)
{
return abs(rcCommand[ROLL]) < ap_mode && abs(rcCommand[PITCH]) < ap_mode;

1
src/main/io/rc_controls.h

@ -213,3 +213,4 @@ void configureAdjustment(uint8_t index, uint8_t auxChannelIndex, const adjustmen
void updateAdjustmentStates(adjustmentRange_t *adjustmentRanges);
void processRcAdjustments(controlRateConfig_t *controlRateConfig, rxConfig_t *rxConfig);
bool isUsingSticksForArming(void);

7
src/main/mw.c

@ -498,9 +498,12 @@ void processRx(void)
}
// 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)
if (
ARMING_FLAG(ARMED)
&& feature(FEATURE_MOTOR_STOP) && !STATE(FIXED_WING)
&& masterConfig.auto_disarm_delay != 0) {
&& masterConfig.auto_disarm_delay != 0
&& isUsingSticksForArming()
) {
if (throttleStatus == THROTTLE_LOW) {
if ((int32_t)(disarmAt - millis()) < 0) // delay is over
mwDisarm();

Loading…
Cancel
Save