From 13b353ea3f810051916c746825ed2089d2d4aca1 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Wed, 29 Mar 2017 11:01:26 +0100 Subject: [PATCH] Got rid of extiConfig_t, ust use ioTag directly instead --- src/main/drivers/accgyro.h | 2 +- src/main/drivers/accgyro_mpu.c | 4 ++-- src/main/drivers/exti.h | 5 ----- src/main/sensors/gyro.c | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/drivers/accgyro.h b/src/main/drivers/accgyro.h index d6e161006..8ad3b43cc 100644 --- a/src/main/drivers/accgyro.h +++ b/src/main/drivers/accgyro.h @@ -60,7 +60,7 @@ typedef struct gyroDev_s { volatile bool dataReady; sensor_align_e gyroAlign; mpuDetectionResult_t mpuDetectionResult; - extiConfig_t mpuIntExtiConfig; + ioTag_t mpuIntExtiTag; mpuConfiguration_t mpuConfiguration; } gyroDev_t; diff --git a/src/main/drivers/accgyro_mpu.c b/src/main/drivers/accgyro_mpu.c index 8470e8e56..89884a05b 100644 --- a/src/main/drivers/accgyro_mpu.c +++ b/src/main/drivers/accgyro_mpu.c @@ -129,11 +129,11 @@ static void mpuIntExtiHandler(extiCallbackRec_t *cb) static void mpuIntExtiInit(gyroDev_t *gyro) { #if defined(MPU_INT_EXTI) - if (gyro->mpuIntExtiConfig.tag == IO_TAG_NONE) { + if (gyro->mpuIntExtiTag == IO_TAG_NONE) { return; } - const IO_t mpuIntIO = IOGetByTag(gyro->mpuIntExtiConfig.tag); + const IO_t mpuIntIO = IOGetByTag(gyro->mpuIntExtiTag); #ifdef ENSURE_MPU_DATA_READY_IS_LOW uint8_t status = IORead(mpuIntIO); diff --git a/src/main/drivers/exti.h b/src/main/drivers/exti.h index fbdcd3c09..202cd544c 100644 --- a/src/main/drivers/exti.h +++ b/src/main/drivers/exti.h @@ -22,11 +22,6 @@ #include "io_types.h" -// old EXTI interface, to be replaced -typedef struct extiConfig_s { - ioTag_t tag; -} extiConfig_t; - typedef struct extiCallbackRec_s extiCallbackRec_t; typedef void extiHandlerCallback(extiCallbackRec_t *self); diff --git a/src/main/sensors/gyro.c b/src/main/sensors/gyro.c index 8adde6175..78ddf3353 100644 --- a/src/main/sensors/gyro.c +++ b/src/main/sensors/gyro.c @@ -284,11 +284,11 @@ bool gyroInit(void) #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_ICM20601) || defined(USE_GYRO_SPI_ICM20689) #if defined(MPU_INT_EXTI) - gyroDev0.mpuIntExtiConfig.tag = IO_TAG(MPU_INT_EXTI); + gyroDev0.mpuIntExtiTag = IO_TAG(MPU_INT_EXTI); #elif defined(USE_HARDWARE_REVISION_DETECTION) - gyroDev0.mpuIntExtiConfig.tag = selectMPUIntExtiConfigByHardwareRevision(); + gyroDev0.mpuIntExtiTag = selectMPUIntExtiConfigByHardwareRevision(); #else - gyroDev0.mpuIntExtiConfig.tag = IO_TAG_NONE; + gyroDev0.mpuIntExtiTag = IO_TAG_NONE; #endif #ifdef USE_DUAL_GYRO