mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
SPRacingF7DUAL - Dual SIMULTANEOUS gyro support. (#5264)
* CF/BF - Set STM32F7 SPI FAST clock to 13.5Mhz - Gyros not stable at 27mhz. * CF/BF - Initial SPRacingF7DUAL commit. Support two simultaneous gyro support (code by Dominic Clifton and Martin Budden) There are new debug modes so you can see the difference between each gyro. Notes: * spi bus instance caching broke spi mpu detection because the detection tries I2C first which overwrites the selected bus instance when using dual gyro. * ALL other dual-gyro boards have one sensor per bus. SPRacingF7DUAL is has two per bus and thus commit has a lot of changes to fix SPI/BUS/GYRO initialisation issues. * CF/BF - Add SPRacingF4EVODG target. This target adds a second gyro to the board using the SPI pads on the back of the board. * CF/BF - Temporarily disable Gyro EXTI pin to allow NEO target to build.
This commit is contained in:
parent
9bcc6aca8e
commit
cde9a9517b
29 changed files with 797 additions and 117 deletions
|
@ -133,7 +133,6 @@ bool accDetect(accDev_t *dev, accelerationSensor_e accHardwareToUse)
|
|||
#endif
|
||||
|
||||
retry:
|
||||
dev->accAlign = ALIGN_DEFAULT;
|
||||
|
||||
switch (accHardwareToUse) {
|
||||
case ACC_DEFAULT:
|
||||
|
@ -333,6 +332,17 @@ bool accInit(uint32_t gyroSamplingInverval)
|
|||
acc.dev.bus = *gyroSensorBus();
|
||||
acc.dev.mpuDetectionResult = *gyroMpuDetectionResult();
|
||||
acc.dev.acc_high_fsr = accelerometerConfig()->acc_high_fsr;
|
||||
|
||||
#ifdef USE_DUAL_GYRO
|
||||
if (gyroConfig()->gyro_to_use == GYRO_CONFIG_USE_GYRO_2) {
|
||||
acc.dev.accAlign = ACC_2_ALIGN;
|
||||
} else {
|
||||
acc.dev.accAlign = ACC_1_ALIGN;
|
||||
}
|
||||
#else
|
||||
acc.dev.accAlign = ALIGN_DEFAULT;
|
||||
#endif
|
||||
|
||||
if (!accDetect(&acc.dev, accelerometerConfig()->acc_hardware)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue