mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Merge pull request #10429 from etracer65/fix_raceflight_rate_reset
Fix logic error for RACEFLIGHT and KISS rates range checks
This commit is contained in:
commit
2126aa17e6
1 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,7 @@ pidProfile_t *currentPidProfile;
|
|||
#define DYNAMIC_FILTER_MAX_SUPPORTED_LOOP_TIME HZ_TO_INTERVAL_US(2000)
|
||||
|
||||
#define BETAFLIGHT_MAX_SRATE 100
|
||||
#define KISS_MAX_SRATE 100
|
||||
#define KISS_MAX_SRATE 99
|
||||
#define QUICK_MAX_RATE 200
|
||||
#define ACTUAL_MAX_RATE 200
|
||||
|
||||
|
@ -580,6 +580,8 @@ static void validateAndFixConfig(void)
|
|||
}
|
||||
|
||||
break;
|
||||
case RATES_TYPE_RACEFLIGHT:
|
||||
break; // no range constraint is necessary - allows 0 - 255
|
||||
case RATES_TYPE_KISS:
|
||||
for (int axis = FD_ROLL; axis <= FD_YAW; axis++) {
|
||||
controlRateProfilesMutable(i)->rates[axis] = constrain(controlRateProfilesMutable(i)->rates[axis], 0, KISS_MAX_SRATE);
|
||||
|
@ -596,6 +598,8 @@ static void validateAndFixConfig(void)
|
|||
for (int axis = FD_ROLL; axis <= FD_YAW; axis++) {
|
||||
controlRateProfilesMutable(i)->rates[axis] = constrain(controlRateProfilesMutable(i)->rates[axis], 0, QUICK_MAX_RATE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue