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

Use Naze hardware revision when initialising adxl345 - this now allows

the driver to be used by any target with an hse_value of 12Mhz.
This commit is contained in:
Dominic Clifton 2014-10-15 21:16:52 +01:00
parent a4879cc2e3
commit 6162f609ea
2 changed files with 11 additions and 7 deletions

View file

@ -56,6 +56,10 @@
#include "sensors/compass.h"
#include "sensors/sonar.h"
#ifdef NAZE
#include "hardware_revision.h"
#endif
extern float magneticDeclination;
extern gyro_t gyro;
@ -191,12 +195,16 @@ retry:
case ACC_ADXL345: // ADXL345
acc_params.useFifo = false;
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;
#ifdef NAZE
accAlign = CW270_DEG;
#endif
}
#endif
if (accHardwareToUse == ACC_ADXL345)
break;
; // fallthrough