mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
IDLE UP switch // Remove pid_at_min_throttle
This commit is contained in:
parent
769ddd39af
commit
eafa631a32
7 changed files with 11 additions and 40 deletions
|
@ -100,7 +100,6 @@ enum {
|
|||
#define PREVENT_RX_PROCESS_PRE_LOOP_TRIGGER 80 // Prevent RX processing before expected loop trigger
|
||||
#define PREVENT_BARO_READ_PRE_LOOP_TRIGGER 150 // Prevent BARO processing before expected loop trigger
|
||||
#define GYRO_RATE 0.001f // Gyro refresh rate 1khz
|
||||
#define PID_AT_MIN_THROTTLE_ITERM_DELAY (3 * 1000)
|
||||
|
||||
uint32_t currentTime = 0;
|
||||
uint32_t previousTime = 0;
|
||||
|
@ -542,7 +541,6 @@ void executePeriodicTasks(bool skipBaroUpdate)
|
|||
void processRx(void)
|
||||
{
|
||||
static bool armedBeeperOn = false;
|
||||
static uint32_t pidResetErrorGyroTimeout = 0;
|
||||
|
||||
calculateRxChannelsAndUpdateFailsafe(currentTime);
|
||||
|
||||
|
@ -565,21 +563,9 @@ void processRx(void)
|
|||
|
||||
throttleStatus_e throttleStatus = calculateThrottleStatus(&masterConfig.rxConfig, masterConfig.flight3DConfig.deadband3d_throttle);
|
||||
|
||||
if (throttleStatus == THROTTLE_LOW) {
|
||||
if (throttleStatus == THROTTLE_LOW && !(IS_RC_MODE_ACTIVE(BOXIDLE_UP))) {
|
||||
pidResetErrorAngle();
|
||||
/*
|
||||
* Additional code to prevent Iterm reset below min_check. pid_at_min_throttle higher than 1 will
|
||||
* activate the feature. Experimental yet. Minimum configuration is 2 sec and maxx is 5seconds.
|
||||
*/
|
||||
if (masterConfig.mixerConfig.pid_at_min_throttle > 1 && ARMING_FLAG(ARMED)) {
|
||||
if (pidResetErrorGyroTimeout < millis()) {
|
||||
pidResetErrorGyro();
|
||||
}
|
||||
} else {
|
||||
pidResetErrorGyro();
|
||||
}
|
||||
} else {
|
||||
pidResetErrorGyroTimeout = millis() + PID_AT_MIN_THROTTLE_ITERM_DELAY;
|
||||
pidResetErrorGyro();
|
||||
}
|
||||
|
||||
// When armed and motors aren't spinning, do beeps and then disarm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue