1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

address style requests

This commit is contained in:
Thorsten Laux 2018-05-25 07:16:23 +02:00
parent e1ff2566c6
commit 0086932946

View file

@ -607,7 +607,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
currentPidSetpoint = 0.0f;
}
#endif // USE_YAW_SPIN_RECOVERY
// -----calculate error rate
const float gyroRate = gyro.gyroADCf[axis]; // Process variable from gyro output in deg/sec
float errorRate = currentPidSetpoint - gyroRate; // r - y
@ -635,10 +635,12 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
DEBUG_SET(DEBUG_ITERM_RELAX, 1, gyroTargetLow);
const float gmax = MAX(gyroTargetHigh, gyroTargetLow);
const float gmin = MIN(gyroTargetHigh, gyroTargetLow);
if (gyroRate >= gmin && gyroRate <= gmax)
if (gyroRate >= gmin && gyroRate <= gmax) {
itermErrorRate = 0.0f;
else
}
else {
itermErrorRate = (gyroRate > gmax ? gmax : gmin ) - gyroRate;
}
}
else itermErrorRate = errorRate;