Merge pull request #2024 from mikeller/fix_gyro_data_ready_without_exti

Fixed gyro update / arming for targets without gyro interrupt.
This commit is contained in:
borisbstyle 2017-01-06 11:34:55 +01:00 committed by GitHub
commit e82785d76f
1 changed files with 7 additions and 0 deletions

View File

@ -400,9 +400,16 @@ static bool gyroUpdateISR(gyroDev_t* gyroDev)
void gyroUpdate(void)
{
// range: +/- 8192; +/- 2000 deg/sec
#if defined(MPU_INT_EXTI)
if (!gyro.dev.dataReady || !gyro.dev.read(&gyro.dev)) {
return;
}
#else
if (!gyro.dev.read(&gyro.dev)) {
return;
}
#endif
const bool calibrationComplete = isGyroCalibrationComplete();
if (calibrationComplete) {
#if defined(GYRO_USES_SPI) && defined(USE_MPU_DATA_READY_SIGNAL)