1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

LP-309 skip edge detection if not transitioning from fully ARMED/DISARMED state

This commit is contained in:
Vladimir Zidar 2016-05-11 12:01:31 +02:00
parent 633d8d4969
commit 5205d95a8c

View File

@ -203,6 +203,11 @@ void armHandler(bool newinit, FrameType_t frameType)
previousArmingInputLevel = 0.0f;
}
// ignore previous arming input level if not transitioning from fully ARMED/DISARMED states.
if((armState != ARM_STATE_DISARMED) && (armState != ARM_STATE_ARMED)) {
previousArmingInputLevel = 0.0f;
}
if ((armingInputLevel <= -ARMED_THRESHOLD) && (previousArmingInputLevel > -ARMED_THRESHOLD)) {
manualArm = true;
} else if ((armingInputLevel >= +ARMED_THRESHOLD) && (previousArmingInputLevel < +ARMED_THRESHOLD)) {