diff --git a/src/main/mw.c b/src/main/mw.c index 4a91d15df4..808a204a97 100644 --- a/src/main/mw.c +++ b/src/main/mw.c @@ -738,23 +738,6 @@ void filterRc(void){ } } -// Function for loop trigger -bool runLoop(uint32_t loopTime) { - bool loopTrigger = false; - - if (masterConfig.syncGyroToLoop) { - if (gyroSyncCheckUpdate() || (int32_t)(currentTime - (loopTime + GYRO_WATCHDOG_DELAY)) >= 0) { - loopTrigger = true; - } - } - - else if ((int32_t)(currentTime - loopTime) >= 0){ - loopTrigger = true; - } - - return loopTrigger; -} - void loop(void) { static uint32_t loopTime; @@ -801,7 +784,7 @@ void loop(void) } currentTime = micros(); - if (runLoop(loopTime)) { + if ((!masterConfig.syncGyroToLoop && masterConfig.looptime == 0) || ((int32_t)(currentTime - loopTime) >= 0)) { loopTime = currentTime + targetLooptime;