File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ class Model
359359 // for synced and standard PWM limit loop rate and pwm pulse width
360360 if (config.output .protocol == ESC_PROTOCOL_PWM && state.loopRate > 500 )
361361 {
362- config.loopSync = std::max (config.loopSync , (int8_t )((state.loopRate + 499 ) / 500 )); // align loop rate to lower than 500Hz
362+ config.loopSync = std::max (config.loopSync , (int8_t )((state.gyroRate + 499 ) / 500 )); // align loop rate to lower than 500Hz
363363 state.loopRate = state.gyroRate / config.loopSync ;
364364 if (state.loopRate > 480 && config.output .maxThrottle > 1940 )
365365 {
@@ -369,7 +369,7 @@ class Model
369369 // for onshot125 limit loop rate to 2kHz
370370 if (config.output .protocol == ESC_PROTOCOL_ONESHOT125 && state.loopRate > 2000 )
371371 {
372- config.loopSync = std::max (config.loopSync , (int8_t )((state.loopRate + 1999 ) / 2000 )); // align loop rate to lower than 2000Hz
372+ config.loopSync = std::max (config.loopSync , (int8_t )((state.gyroRate + 1999 ) / 2000 )); // align loop rate to lower than 2000Hz
373373 state.loopRate = state.gyroRate / config.loopSync ;
374374 }
375375 }
You can’t perform that action at this time.
0 commit comments