Got rid of extiConfig_t, ust use ioTag directly instead

This commit is contained in:
Martin Budden 2017-03-29 11:01:26 +01:00
parent 21014481b1
commit 13b353ea3f
4 changed files with 6 additions and 11 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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