mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-20 23:05:17 +03:00
limit time of braking mode
This commit is contained in:
parent
0ac6e55f81
commit
4d8fea95f7
1 changed files with 13 additions and 0 deletions
|
@ -1959,6 +1959,7 @@ static void resetPositionController(void)
|
||||||
static bool adjustPositionFromRCInput(void)
|
static bool adjustPositionFromRCInput(void)
|
||||||
{
|
{
|
||||||
bool retValue;
|
bool retValue;
|
||||||
|
static uint32_t brakingModeDisengageAt = 0;
|
||||||
|
|
||||||
if (STATE(FIXED_WING)) {
|
if (STATE(FIXED_WING)) {
|
||||||
retValue = adjustFixedWingPositionFromRCInput();
|
retValue = adjustFixedWingPositionFromRCInput();
|
||||||
|
@ -1990,6 +1991,18 @@ static bool adjustPositionFromRCInput(void)
|
||||||
) {
|
) {
|
||||||
ENABLE_STATE(NAV_CRUISE_BRAKING);
|
ENABLE_STATE(NAV_CRUISE_BRAKING);
|
||||||
DEBUG_SET(DEBUG_BRAKING, 0, 1);
|
DEBUG_SET(DEBUG_BRAKING, 0, 1);
|
||||||
|
|
||||||
|
//Set forced BRAKING disengage moment
|
||||||
|
brakingModeDisengageAt = millis() + 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Forced BRAKING disengage routine
|
||||||
|
if (
|
||||||
|
STATE(NAV_CRUISE_BRAKING) &&
|
||||||
|
brakingModeDisengageAt < millis()
|
||||||
|
) {
|
||||||
|
DISABLE_STATE(NAV_CRUISE_BRAKING);
|
||||||
|
DEBUG_SET(DEBUG_BRAKING, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue