mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
ICM20689 Gyro Fix
This commit is contained in:
parent
c96bb34fda
commit
6dbded7071
3 changed files with 23 additions and 9 deletions
|
@ -81,17 +81,31 @@ static void icm20689SpiInit(void)
|
|||
bool icm20689SpiDetect(void)
|
||||
{
|
||||
uint8_t tmp;
|
||||
uint8_t attemptsRemaining = 20;
|
||||
|
||||
icm20689SpiInit();
|
||||
|
||||
spiSetDivisor(ICM20689_SPI_INSTANCE, SPI_CLOCK_INITIALIZATON); //low speed
|
||||
|
||||
icm20689WriteRegister(MPU_RA_PWR_MGMT_1, ICM20689_BIT_RESET);
|
||||
|
||||
do {
|
||||
delay(150);
|
||||
|
||||
icm20689ReadRegister(MPU_RA_WHO_AM_I, 1, &tmp);
|
||||
|
||||
if (tmp == ICM20689_WHO_AM_I_CONST) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!attemptsRemaining) {
|
||||
return false;
|
||||
}
|
||||
} while (attemptsRemaining--);
|
||||
|
||||
spiSetDivisor(ICM20689_SPI_INSTANCE, SPI_CLOCK_FAST);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool icm20689SpiAccDetect(acc_t *acc)
|
||||
{
|
||||
|
|
|
@ -241,9 +241,9 @@ static const char * const sensorTypeNames[] = {
|
|||
|
||||
#define SENSOR_NAMES_MASK (SENSOR_GYRO | SENSOR_ACC | SENSOR_BARO | SENSOR_MAG)
|
||||
|
||||
static const char * const sensorHardwareNames[4][13] = {
|
||||
static const char * const sensorHardwareNames[4][12] = {
|
||||
{ "", "None", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", "MPU6000", "MPU6500", "MPU9250", "ICM20689", "FAKE", NULL },
|
||||
{ "", "None", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "ICM20689", "FAKE", NULL },
|
||||
{ "", "None", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "ICM20689", "FAKE", NULL },
|
||||
{ "", "None", "BMP085", "MS5611", "BMP280", NULL },
|
||||
{ "", "None", "HMC5883", "AK8975", "AK8963", NULL }
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue