diff --git a/src/main/drivers/accgyro/accgyro_spi_mpu6500.c b/src/main/drivers/accgyro/accgyro_spi_mpu6500.c index 7e8a45deda..816733de64 100755 --- a/src/main/drivers/accgyro/accgyro_spi_mpu6500.c +++ b/src/main/drivers/accgyro/accgyro_spi_mpu6500.c @@ -49,6 +49,14 @@ bool mpu6500SpiWriteRegister(const busDevice_t *bus, uint8_t reg, uint8_t data) return true; } +bool mpu6500SpiWriteRegisterDelayed(const busDevice_t *bus, uint8_t reg, uint8_t data) +{ + mpu6500SpiWriteRegister(bus, reg, data); + delayMicroseconds(10); + + return true; +} + bool mpu6500SpiReadRegister(const busDevice_t *bus, uint8_t reg, uint8_t length, uint8_t *data) { ENABLE_MPU6500(bus->spi.csnPin); diff --git a/src/main/drivers/accgyro/accgyro_spi_mpu6500.h b/src/main/drivers/accgyro/accgyro_spi_mpu6500.h index 4eea122946..e2d1ef91b2 100755 --- a/src/main/drivers/accgyro/accgyro_spi_mpu6500.h +++ b/src/main/drivers/accgyro/accgyro_spi_mpu6500.h @@ -25,6 +25,7 @@ bool mpu6500SpiAccDetect(accDev_t *acc); bool mpu6500SpiGyroDetect(gyroDev_t *gyro); bool mpu6500SpiWriteRegister(const busDevice_t *bus, uint8_t reg, uint8_t data); +bool mpu6500SpiWriteRegisterDelayed(const busDevice_t *bus, uint8_t reg, uint8_t data); bool mpu6500SpiReadRegister(const busDevice_t *bus, uint8_t reg, uint8_t length, uint8_t *data); void mpu6500SpiGyroInit(gyroDev_t *gyro); diff --git a/src/main/drivers/compass/compass_ak8963.c b/src/main/drivers/compass/compass_ak8963.c index 09cf52e47a..e43df108e7 100644 --- a/src/main/drivers/compass/compass_ak8963.c +++ b/src/main/drivers/compass/compass_ak8963.c @@ -88,7 +88,7 @@ static busDevice_t *bus = NULL; // HACK // Is an separate MPU9250 driver really needed? The GYRO/ACC part between MPU6500 and MPU9250 is exactly the same. #if defined(MPU6500_SPI_INSTANCE) && !defined(MPU9250_SPI_INSTANCE) #define MPU9250_SPI_INSTANCE -#define verifympu9250SpiWriteRegister mpu6500SpiWriteRegister +#define verifympu9250SpiWriteRegister mpu6500SpiWriteRegisterDelayed #define mpu9250SpiWriteRegister mpu6500SpiWriteRegister #define mpu9250SpiReadRegister mpu6500SpiReadRegister #endif @@ -116,7 +116,7 @@ static bool ak8963SensorRead(uint8_t addr_, uint8_t reg_, uint8_t len_, uint8_t verifympu9250SpiWriteRegister(bus, MPU_RA_I2C_SLV0_CTRL, len_ | 0x80); // read number of bytes delay(10); __disable_irq(); - bool ack = mpu9250SpiReadRegister(bus, MPU_RA_EXT_SENS_DATA_00, len_, buf); // read I2C + bool ack = mpu9250SpiReadRegister(bus, MPU_RA_EXT_SENS_DATA_00, len_, buf); // read I2C __enable_irq(); return ack; } diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index 0ab56da79c..210b5a8186 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -2700,8 +2700,8 @@ static void cliTasks(char *cmdline) if (systemConfig()->task_statistics) { cfCheckFuncInfo_t checkFuncInfo; getCheckFuncInfo(&checkFuncInfo); - cliPrintLinef("RX Check Function %17d %7d %25d", checkFuncInfo.maxExecutionTime, checkFuncInfo.averageExecutionTime, checkFuncInfo.totalExecutionTime / 1000); - cliPrintLinef("Total (excluding SERIAL) %23d.%1d%% %4d.%1d%%", maxLoadSum/10, maxLoadSum%10, averageLoadSum/10, averageLoadSum%10); + cliPrintLinef("RX Check Function %19d %7d %25d", checkFuncInfo.maxExecutionTime, checkFuncInfo.averageExecutionTime, checkFuncInfo.totalExecutionTime / 1000); + cliPrintLinef("Total (excluding SERIAL) %25d.%1d%% %4d.%1d%%", maxLoadSum/10, maxLoadSum%10, averageLoadSum/10, averageLoadSum%10); } } #endif diff --git a/src/main/target/ALIENFLIGHTF3/config.c b/src/main/target/ALIENFLIGHTF3/config.c index ce79365016..419060c121 100644 --- a/src/main/target/ALIENFLIGHTF3/config.c +++ b/src/main/target/ALIENFLIGHTF3/config.c @@ -34,7 +34,6 @@ #include "rx/rx.h" -#include "sensors/compass.h" #include "sensors/gyro.h" #include "hardware_revision.h" @@ -81,7 +80,6 @@ void targetConfiguration(void) rxConfigMutable()->spektrum_sat_bind = 5; rxConfigMutable()->spektrum_sat_bind_autoreset = 1; - compassConfigMutable()->mag_hardware = MAG_NONE; // disabled by default if (hardwareMotorType == MOTOR_BRUSHED) { motorConfigMutable()->dev.motorPwmRate = BRUSHED_MOTORS_PWM_RATE; diff --git a/src/main/target/ALIENFLIGHTF3/target.h b/src/main/target/ALIENFLIGHTF3/target.h index 58a83e3086..eac41d692e 100644 --- a/src/main/target/ALIENFLIGHTF3/target.h +++ b/src/main/target/ALIENFLIGHTF3/target.h @@ -90,6 +90,7 @@ #define UART3_RX_PIN PB11 #define USE_I2C +#define USE_I2C_PULLUP #define USE_I2C_DEVICE_2 #define I2C_DEVICE (I2CDEV_2) #define I2C2_SCL PA9 diff --git a/src/main/target/ALIENFLIGHTF4/config.c b/src/main/target/ALIENFLIGHTF4/config.c index cc2697c5ac..6a79611f05 100644 --- a/src/main/target/ALIENFLIGHTF4/config.c +++ b/src/main/target/ALIENFLIGHTF4/config.c @@ -40,7 +40,6 @@ #include "telemetry/telemetry.h" #include "sensors/battery.h" -#include "sensors/compass.h" #include "hardware_revision.h" @@ -53,8 +52,6 @@ // alternative defaults settings for AlienFlight targets void targetConfiguration(void) { - compassConfigMutable()->mag_hardware = MAG_NONE; // disabled by default - if (hardwareMotorType == MOTOR_BRUSHED) { motorConfigMutable()->dev.motorPwmRate = BRUSHED_MOTORS_PWM_RATE; pidConfigMutable()->pid_process_denom = 1; diff --git a/src/main/target/ALIENFLIGHTF4/target.h b/src/main/target/ALIENFLIGHTF4/target.h index 21c14173f1..e77aabf946 100644 --- a/src/main/target/ALIENFLIGHTF4/target.h +++ b/src/main/target/ALIENFLIGHTF4/target.h @@ -138,6 +138,7 @@ #define USE_SPI_DEVICE_3 #define USE_I2C +#define USE_I2C_PULLUP #define USE_I2C_DEVICE_1 #define I2C_DEVICE (I2CDEV_1) #define I2C1_SCL PB6 diff --git a/src/main/target/ALIENFLIGHTNGF7/config.c b/src/main/target/ALIENFLIGHTNGF7/config.c index cab4efe139..d48c82f7bb 100644 --- a/src/main/target/ALIENFLIGHTNGF7/config.c +++ b/src/main/target/ALIENFLIGHTNGF7/config.c @@ -39,7 +39,6 @@ #include "telemetry/telemetry.h" #include "sensors/battery.h" -#include "sensors/compass.h" #include "hardware_revision.h" @@ -52,8 +51,6 @@ // alternative defaults settings for AlienFlight targets void targetConfiguration(void) { - compassConfigMutable()->mag_hardware = MAG_NONE; // disabled by default - if (hardwareMotorType == MOTOR_BRUSHED) { motorConfigMutable()->dev.motorPwmRate = BRUSHED_MOTORS_PWM_RATE; pidConfigMutable()->pid_process_denom = 1; diff --git a/src/main/target/ALIENFLIGHTNGF7/target.h b/src/main/target/ALIENFLIGHTNGF7/target.h index 634bb0610b..b3e3cd4e29 100644 --- a/src/main/target/ALIENFLIGHTNGF7/target.h +++ b/src/main/target/ALIENFLIGHTNGF7/target.h @@ -149,6 +149,7 @@ #define SPI3_MOSI_PIN PB5 #define USE_I2C +#define USE_I2C_PULLUP #define I2C_DEVICE (I2CDEV_1) //#define I2C_DEVICE_EXT (I2CDEV_2) #define I2C1_SCL PB6 diff --git a/src/main/target/COLIBRI_RACE/target.h b/src/main/target/COLIBRI_RACE/target.h index 2570d83f55..08917d2f2f 100755 --- a/src/main/target/COLIBRI_RACE/target.h +++ b/src/main/target/COLIBRI_RACE/target.h @@ -73,7 +73,6 @@ #define USE_BARO_MS5611 #define MAG -#define USE_MPU9250_MAG #define USE_MAG_HMC5883 #define USE_MAG_AK8963 #define USE_MAG_AK8975 diff --git a/src/main/target/RCEXPLORERF3/target.h b/src/main/target/RCEXPLORERF3/target.h index 7ef39d054f..92d59bc51c 100644 --- a/src/main/target/RCEXPLORERF3/target.h +++ b/src/main/target/RCEXPLORERF3/target.h @@ -48,7 +48,6 @@ #define USE_BARO_MS5611 #define MAG -#define USE_MPU9250_MAG // Enables bypass configuration #define USE_MAG_AK8975 #define USE_MAG_HMC5883 // External diff --git a/src/main/target/SPRACINGF3EVO/target.h b/src/main/target/SPRACINGF3EVO/target.h index eb3f85c1c5..a314a229a2 100755 --- a/src/main/target/SPRACINGF3EVO/target.h +++ b/src/main/target/SPRACINGF3EVO/target.h @@ -58,7 +58,6 @@ #define USE_BARO_BMP280 #define MAG -#define USE_MPU9250_MAG // Enables bypass configuration #define USE_MAG_AK8963 //#define USE_MAG_HMC5883 // External