From dc3b89e78c67d6bd027d57733cd80648f47092f1 Mon Sep 17 00:00:00 2001 From: blckmn Date: Fri, 3 Feb 2017 09:51:22 +1100 Subject: [PATCH] check for PWM_rate limits --- 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 d5deb21ff..9acb623d4 100755 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -937,8 +937,12 @@ void activateConfig(void) void validateAndFixConfig(void) { - if((motorConfig()->motorPwmProtocol == PWM_TYPE_BRUSHED) && (motorConfig()->mincommand < 1000)){ - motorConfig()->mincommand = 1000; + if((motorConfig()->motorPwmProtocol == PWM_TYPE_BRUSHED) && (motorConfig()->mincommand < 1000)) { + motorConfigMutable()->mincommand = 1000; + } + + if((motorConfig()->motorPwmProtocol == PWM_TYPE_STANDARD) && (motorConfig()->motorPwmRate > 900)) { + motorConfig()->motorPwmRate = 400; } if (!(featureConfigured(FEATURE_RX_PARALLEL_PWM) || featureConfigured(FEATURE_RX_PPM) || featureConfigured(FEATURE_RX_SERIAL) || featureConfigured(FEATURE_RX_MSP) || featureConfigured(FEATURE_RX_SPI))) {