From 3168f6ba88965344855b316da55a471adf562242 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Fri, 27 Jan 2017 10:34:08 +1300 Subject: [PATCH] Fixed 'gyro_sync_denom' limiting when using 32kHz gyro. --- src/main/fc/config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/fc/config.c b/src/main/fc/config.c index a4cebaef3..6ee2698c1 100755 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -1078,9 +1078,13 @@ void validateAndFixGyroConfig(void) samplingTime = 0.00003125; // F1 and F3 can't handle high sample speed. #if defined(STM32F1) - gyroConfig()->gyro_sync_denom = constrain(gyroConfig()->gyro_sync_denom, 16, 16); + gyroConfig()->gyro_sync_denom = MAX(gyroConfig()->gyro_sync_denom, 16); #elif defined(STM32F3) - gyroConfig()->gyro_sync_denom = constrain(gyroConfig()->gyro_sync_denom, 4, 16); + gyroConfig()->gyro_sync_denom = MAX(gyroConfig()->gyro_sync_denom, 4); +#endif + } else { +#if defined(STM32F1) + gyroConfig()->gyro_sync_denom = MAX(gyroConfig()->gyro_sync_denom, 4); #endif }