mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Merge pull request #8033 from hydra/bf-really-fix-gyro-detection-in-multi-gyro-setups
Really fix gyro detection code code for multi gyro setups.
This commit is contained in:
parent
e15523bfe5
commit
c21d7fb05d
1 changed files with 2 additions and 2 deletions
|
@ -538,7 +538,7 @@ bool gyroInit(void)
|
|||
}
|
||||
|
||||
#if defined(USE_MULTI_GYRO)
|
||||
if ((gyroToUse == GYRO_CONFIG_USE_GYRO_BOTH && !(gyroDetectionFlags & DETECTED_BOTH_GYROS))
|
||||
if ((gyroToUse == GYRO_CONFIG_USE_GYRO_BOTH && !((gyroDetectionFlags & DETECTED_BOTH_GYROS) == DETECTED_BOTH_GYROS))
|
||||
|| (gyroToUse == GYRO_CONFIG_USE_GYRO_1 && !(gyroDetectionFlags & DETECTED_GYRO_1))
|
||||
|| (gyroToUse == GYRO_CONFIG_USE_GYRO_2 && !(gyroDetectionFlags & DETECTED_GYRO_2))) {
|
||||
if (gyroDetectionFlags & DETECTED_GYRO_1) {
|
||||
|
@ -551,7 +551,7 @@ bool gyroInit(void)
|
|||
}
|
||||
|
||||
// Only allow using both gyros simultaneously if they are the same hardware type.
|
||||
if ((gyroDetectionFlags & DETECTED_BOTH_GYROS) && gyroSensor1.gyroDev.gyroHardware == gyroSensor2.gyroDev.gyroHardware) {
|
||||
if (((gyroDetectionFlags & DETECTED_BOTH_GYROS) == DETECTED_BOTH_GYROS) && gyroSensor1.gyroDev.gyroHardware == gyroSensor2.gyroDev.gyroHardware) {
|
||||
gyroDetectionFlags |= DETECTED_DUAL_GYROS;
|
||||
} else if (gyroToUse == GYRO_CONFIG_USE_GYRO_BOTH) {
|
||||
// If the user selected "BOTH" and they are not the same type, then reset to using only the first gyro.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue