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