1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Disable SPA for angle mode - fix (for wings) (#13848)

* Disable SPA for angle mode - fix (for wings)

* moved the logic for axisInAngleMode[axis] inside applySpa

* ledvinap's review
This commit is contained in:
Ivan Efimov 2024-08-27 11:57:00 -05:00 committed by GitHub
parent f2bd6e69b2
commit 9205c4594f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -867,7 +867,13 @@ NOINLINE static void calculateSpaValues(const pidProfile_t *pidProfile)
NOINLINE static void applySpa(int axis, const pidProfile_t *pidProfile) NOINLINE static void applySpa(int axis, const pidProfile_t *pidProfile)
{ {
#ifdef USE_WING #ifdef USE_WING
switch(pidProfile->spa_mode[axis]){ spaMode_e mode = pidProfile->spa_mode[axis];
if (pidRuntime.axisInAngleMode[axis]) {
mode = SPA_MODE_OFF;
}
switch(mode) {
case SPA_MODE_PID: case SPA_MODE_PID:
pidData[axis].P *= pidRuntime.spa[axis]; pidData[axis].P *= pidRuntime.spa[axis];
pidData[axis].D *= pidRuntime.spa[axis]; pidData[axis].D *= pidRuntime.spa[axis];