1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

LP-446 - Configurable debounce timer

This commit is contained in:
Alessio Morale 2017-02-14 15:00:15 +01:00 committed by Philippe Renon
parent 4e81bbdd57
commit 99d54668be
2 changed files with 2 additions and 3 deletions

View File

@ -67,8 +67,6 @@
#define ALWAYSTABILIZEACCESSORY_THRESHOLD 0.05f
// Wait 5 seconds before triggering the battery failsafe mode
#define BATTERY_FAILSAFE_DEBOUNCE_TIMER 5000
// defined handlers
static const controlHandler handler_MANUAL = {
@ -574,7 +572,7 @@ void HandleBatteryFailsafe(uint8_t *position, FlightModeSettingsData *modeSettin
if (failsafeStatus == lastFailsafeStatus) {
changeTimestamp = PIOS_DELAY_GetRaw();
} else if ((debounceTimerms < BATTERY_FAILSAFE_DEBOUNCE_TIMER) || failsafeStatus < lastFailsafeStatus) {
} else if ((debounceTimerms < modeSettings->BatteryFailsafeDebounceTimer) || failsafeStatus < lastFailsafeStatus) {
// do not change within the "grace" period and do not "downgrade" the failsafe mode
failsafeStatus = lastFailsafeStatus;
} else {

View File

@ -96,6 +96,7 @@
<field name="PositionHoldOffset" units="m" type="float" elementnames="Horizontal,Vertical" defaultvalue="30,15" description="stick sensitivity for position roam modes"/>
<field name="VarioControlLowPassAlpha" units="" type="float" elements="1" defaultvalue="0.98" description="stick low pass filter for position roam modes"/>
<field name="BatteryFailsafeSwitchPositions" units="" type="int8" elementnames="Warning,Critical" defaultvalue="-1" />
<field name="BatteryFailsafeDebounceTimer" units="ms" type="uint16" elements="1" defaultvalue="5000" />
<field name="FlightModeChangeRestartsPathPlan" units="bool" type="enum" elements="1" options="False,True" defaultvalue="True" description="wether a path plan should continue when interrupted by flight mode change (False), or restart from waypoint 0 (True)"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>