1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

fix compilation without ACC (#14218)

* fix compilation without ACC

- compilatiopn may fail with cryptic message when no ACC is
selected (unused variable `dev`). Mark dev as unused
- MPU6500 is handled differently than all other accs (it is only
driver that adds case labels)
- also make dev UNUSED for gyro

* Update src/main/sensors/acceleration_init.c

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
This commit is contained in:
Petr Ledvina 2025-02-01 22:45:21 +01:00 committed by GitHub
parent 79ecc1ac74
commit e7f0486ebe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -167,11 +167,11 @@ retry:
FALLTHROUGH;
#endif
#if defined(USE_ACC_MPU6500) || defined(USE_ACC_SPI_MPU6500)
case ACC_MPU6500:
case ACC_ICM20601:
case ACC_ICM20602:
case ACC_ICM20608G:
#if defined(USE_ACC_MPU6500) || defined(USE_ACC_SPI_MPU6500)
#ifdef USE_ACC_SPI_MPU6500
if (mpu6500SpiAccDetect(dev)) {
#else
@ -195,8 +195,8 @@ retry:
}
break;
}
#endif
FALLTHROUGH;
#endif
#ifdef USE_ACC_SPI_ICM20649
case ACC_ICM20649:
@ -287,6 +287,7 @@ retry:
default:
case ACC_NONE: // disable ACC
UNUSED(dev);
accHardware = ACC_NONE;
break;
}