diff --git a/src/main/config/config.c b/src/main/config/config.c index dce58b283a..d488f97da7 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -518,7 +518,6 @@ static void resetConf(void) masterConfig.motor_pwm_protocol = PWM_TYPE_ONESHOT125; #endif masterConfig.servo_pwm_rate = 50; - masterConfig.use_unsyncedPwm = false; #ifdef CC3D masterConfig.use_buzzer_p6 = 0; diff --git a/src/main/config/config_master.h b/src/main/config/config_master.h index b065533350..01bf4e8f3f 100644 --- a/src/main/config/config_master.h +++ b/src/main/config/config_master.h @@ -35,7 +35,6 @@ typedef struct master_t { uint16_t motor_pwm_rate; // The update rate of motor outputs (50-498Hz) uint16_t servo_pwm_rate; // The update rate of servo outputs (50-498Hz) uint8_t motor_pwm_protocol; // Pwm Protocol - uint8_t use_unsyncedPwm; // unsync fast pwm protocol from PID loop #ifdef USE_SERVOS servoMixer_t customServoMixer[MAX_SERVO_RULES]; diff --git a/src/main/drivers/pwm_mapping.h b/src/main/drivers/pwm_mapping.h index 0facb7c0eb..9e7ae6b21c 100644 --- a/src/main/drivers/pwm_mapping.h +++ b/src/main/drivers/pwm_mapping.h @@ -54,19 +54,11 @@ typedef struct drv_pwm_config_s { bool useSerialRx; bool useRSSIADC; bool useCurrentMeterADC; -#ifdef STM32F10X bool useUART2; -#endif -#ifdef STM32F303xC bool useUART3; -#endif -#ifdef STM32F4 - bool useUART2; bool useUART6; -#endif bool useVbat; bool useFastPwm; - bool useUnsyncedPwm; bool useSoftSerial; bool useLEDStrip; #ifdef SONAR diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index 2257a91574..b986caf921 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -582,13 +582,11 @@ const clivalue_t valueTable[] = { { "3d_neutral", VAR_UINT16 | MASTER_VALUE, &masterConfig.flight3DConfig.neutral3d, .config.minmax = { PWM_RANGE_ZERO, PWM_RANGE_MAX } }, { "3d_deadband_throttle", VAR_UINT16 | MASTER_VALUE, &masterConfig.flight3DConfig.deadband3d_throttle, .config.minmax = { PWM_RANGE_ZERO, PWM_RANGE_MAX } }, - { "unsynced_fast_pwm", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.use_unsyncedPwm, .config.lookup = { TABLE_OFF_ON } }, - { "fast_pwm_protocol", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.motor_pwm_protocol, .config.lookup = { TABLE_MOTOR_PWM_PROTOCOL } }, - { "motor_pwm_protocol", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.motor_pwm_protocol, .config.lookup = { TABLE_MOTOR_PWM_PROTOCOL } }, #ifdef CC3D { "enable_buzzer_p6", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.use_buzzer_p6, .config.lookup = { TABLE_OFF_ON } }, #endif - { "motor_pwm_rate", VAR_UINT16 | MASTER_VALUE, &masterConfig.motor_pwm_rate, .config.minmax = { 200, 32000 } }, + { "motor_pwm_protocol", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.motor_pwm_protocol, .config.lookup = { TABLE_MOTOR_PWM_PROTOCOL } }, + { "motor_pwm_rate", VAR_UINT16 | MASTER_VALUE, &masterConfig.motor_pwm_rate, .config.minmax = { 200, 32000 } }, { "servo_pwm_rate", VAR_UINT16 | MASTER_VALUE, &masterConfig.servo_pwm_rate, .config.minmax = { 50, 498 } }, { "disarm_kill_switch", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.disarm_kill_switch, .config.lookup = { TABLE_OFF_ON } }, diff --git a/src/main/main.c b/src/main/main.c index ce704dfcff..f00e88af37 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -334,12 +334,12 @@ void init(void) } else { featureClear(FEATURE_ONESHOT125); } - - pwm_params.useFastPwm = (masterConfig.motor_pwm_protocol != PWM_TYPE_CONVENTIONAL && masterConfig.motor_pwm_protocol != PWM_TYPE_BRUSHED); // Configurator feature abused for enabling Fast PWM + + // Configurator feature abused for enabling Fast PWM + pwm_params.useFastPwm = (masterConfig.motor_pwm_protocol != PWM_TYPE_CONVENTIONAL && masterConfig.motor_pwm_protocol != PWM_TYPE_BRUSHED); pwm_params.pwmProtocolType = masterConfig.motor_pwm_protocol; pwm_params.motorPwmRate = masterConfig.motor_pwm_rate; pwm_params.idlePulse = masterConfig.escAndServoConfig.mincommand; - pwm_params.useUnsyncedPwm = masterConfig.use_unsyncedPwm; if (feature(FEATURE_3D)) pwm_params.idlePulse = masterConfig.flight3DConfig.neutral3d; if (masterConfig.motor_pwm_protocol == PWM_TYPE_BRUSHED) @@ -351,7 +351,7 @@ void init(void) pwmOutputConfiguration_t *pwmOutputConfiguration = pwmInit(&pwm_params); - syncMotors(pwm_params.useUnsyncedPwm && pwm_params.motorPwmRate != PWM_TYPE_BRUSHED); + syncMotors(pwm_params.motorPwmRate == 0 && pwm_params.motorPwmRate != PWM_TYPE_BRUSHED); mixerUsePWMOutputConfiguration(pwmOutputConfiguration); if (!feature(FEATURE_ONESHOT125))