From 50561bfb5ff0e1a94408b822b1241e39ccc5d274 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Thu, 18 Jul 2013 13:13:23 +0200 Subject: [PATCH] made arming/disarming sequence time configurable - useful for heli pilots that like almost-instant disarm --- flight/modules/ManualControl/manualcontrol.c | 5 ++--- shared/uavobjectdefinition/manualcontrolsettings.xml | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flight/modules/ManualControl/manualcontrol.c b/flight/modules/ManualControl/manualcontrol.c index 314932e01..e70b064e1 100644 --- a/flight/modules/ManualControl/manualcontrol.c +++ b/flight/modules/ManualControl/manualcontrol.c @@ -67,7 +67,6 @@ #define TASK_PRIORITY (tskIDLE_PRIORITY + 4) #define UPDATE_PERIOD_MS 20 #define THROTTLE_FAILSAFE -0.1f -#define ARMED_TIME_MS 1000 #define ARMED_THRESHOLD 0.50f // safe band to allow a bit of calibration error or trim offset (in microseconds) #define CONNECTION_OFFSET 250 @@ -1137,7 +1136,7 @@ static void processArm(ManualControlCommandData *cmd, ManualControlSettingsData case ARM_STATE_ARMING_MANUAL: setArmedIfChanged(FLIGHTSTATUS_ARMED_ARMING); - if (manualArm && (timeDifferenceMs(armedDisarmStart, lastSysTime) > ARMED_TIME_MS)) { + if (manualArm && (timeDifferenceMs(armedDisarmStart, lastSysTime) > settings->ArmingSequenceTime)) { armState = ARM_STATE_ARMED; } else if (!manualArm) { armState = ARM_STATE_DISARMED; @@ -1166,7 +1165,7 @@ static void processArm(ManualControlCommandData *cmd, ManualControlSettingsData break; case ARM_STATE_DISARMING_MANUAL: - if (manualDisarm && (timeDifferenceMs(armedDisarmStart, lastSysTime) > ARMED_TIME_MS)) { + if (manualDisarm && (timeDifferenceMs(armedDisarmStart, lastSysTime) > settings->DisarmingSequenceTime)) { armState = ARM_STATE_DISARMED; } else if (!manualDisarm) { armState = ARM_STATE_ARMED; diff --git a/shared/uavobjectdefinition/manualcontrolsettings.xml b/shared/uavobjectdefinition/manualcontrolsettings.xml index 4b29c5715..535e3fc8d 100644 --- a/shared/uavobjectdefinition/manualcontrolsettings.xml +++ b/shared/uavobjectdefinition/manualcontrolsettings.xml @@ -71,6 +71,8 @@ %0903NE:Autotune:AltitudeVario:AltitudeHold:VelocityControl:PositionHold:ReturnToBase:Land:PathPlanner:POI"/> + +