1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Moved EXTI into gyroDev_t

This commit is contained in:
Martin Budden 2016-12-11 12:17:30 +00:00
parent cd9a18dbab
commit d9a2f7f5d9
4 changed files with 35 additions and 41 deletions

View file

@ -20,14 +20,12 @@
#include "platform.h"
#include "build/build_config.h"
#include "common/axis.h"
#include "common/utils.h"
#include "config/feature.h"
#include "drivers/accgyro_mpu.h"
#include "drivers/io.h"
#include "drivers/system.h"
#include "drivers/exti.h"
#include "drivers/sensor.h"
@ -55,18 +53,6 @@
uint8_t detectedSensors[SENSOR_INDEX_COUNT] = { GYRO_NONE, ACC_NONE, BARO_NONE, MAG_NONE };
const extiConfig_t *selectMPUIntExtiConfig(void)
{
#if defined(MPU_INT_EXTI)
static const extiConfig_t mpuIntExtiConfig = { .tag = IO_TAG(MPU_INT_EXTI) };
return &mpuIntExtiConfig;
#elif defined(USE_HARDWARE_REVISION_DETECTION)
return selectMPUIntExtiConfigByHardwareRevision();
#else
return NULL;
#endif
}
#ifdef SONAR
static bool sonarDetect(void)
{
@ -86,15 +72,6 @@ bool sensorsAutodetect(const gyroConfig_t *gyroConfig,
const barometerConfig_t *barometerConfig,
const sonarConfig_t *sonarConfig)
{
#if defined(USE_GYRO_MPU6050) || defined(USE_GYRO_MPU3050) || defined(USE_GYRO_MPU6500) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_MPU6000) || defined(USE_ACC_MPU6050) || defined(USE_GYRO_SPI_MPU9250) || defined(USE_GYRO_SPI_ICM20689)
const extiConfig_t *extiConfig = selectMPUIntExtiConfig();
mpuDetectionResult_t *mpuDetectionResult = mpuDetect(extiConfig);
UNUSED(mpuDetectionResult);
#endif
memset(&gyro, 0, sizeof(gyro));
if (!gyroDetect(&gyro.dev)) {
return false;