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

Use Naze hardware revision when initialising mma845. Cleanup ADXL345

initialisation.
This commit is contained in:
Dominic Clifton 2014-10-16 00:56:02 +01:00
parent 50391f2c8e
commit 8f9a553a9e
2 changed files with 10 additions and 12 deletions

View file

@ -219,16 +219,15 @@ retry:
acc_params.dataRate = 800; // unused currently
#ifdef NAZE
if (hardwareRevision < NAZE32_REV5 && adxl345Detect(&acc_params, &acc)) {
accHardware = ACC_ADXL345;
accAlign = CW270_DEG;
}
#else
if (adxl345Detect(&acc_params, &acc)) {
accHardware = ACC_ADXL345;
}
#endif
if (accHardwareToUse == ACC_ADXL345)
break;
accHardware = ACC_ADXL345;
accHardware = ACC_ADXL345;
if (accHardwareToUse == ACC_ADXL345)
break;
}
; // fallthrough
#endif
#ifdef USE_ACC_MPU6050
@ -245,11 +244,14 @@ retry:
#endif
#ifdef USE_ACC_MMA8452
case ACC_MMA8452: // MMA8452
if (mma8452Detect(&acc)) {
accHardware = ACC_MMA8452;
#ifdef NAZE
// Not supported with this frequency
if (hardwareRevision < NAZE32_REV5 && mma8452Detect(&acc)) {
accAlign = CW90_DEG;
#else
if (mma8452Detect(&acc)) {
#endif
accHardware = ACC_MMA8452;
if (accHardwareToUse == ACC_MMA8452)
break;
}