diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index d773419f6d..1bd138a170 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -1530,7 +1530,7 @@ static void cliServoMix(char *cmdline) if (i >= 0 && i < MAX_SERVO_RULES && args[TARGET] >= 0 && args[TARGET] < MAX_SUPPORTED_SERVOS && args[INPUT] >= 0 && args[INPUT] < INPUT_SOURCE_COUNT && - args[RATE] >= -125 && args[RATE] <= 125 && + args[RATE] >= -1000 && args[RATE] <= 1000 && args[SPEED] >= 0 && args[SPEED] <= MAX_SERVO_SPEED) { customServoMixersMutable(i)->targetChannel = args[TARGET]; customServoMixersMutable(i)->inputSource = args[INPUT]; diff --git a/src/main/fc/fc_msp.c b/src/main/fc/fc_msp.c index 01f1a53e63..b82ca1a711 100644 --- a/src/main/fc/fc_msp.c +++ b/src/main/fc/fc_msp.c @@ -455,7 +455,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF for (int i = 0; i < MAX_SERVO_RULES; i++) { sbufWriteU8(dst, customServoMixers(i)->targetChannel); sbufWriteU8(dst, customServoMixers(i)->inputSource); - sbufWriteU8(dst, customServoMixers(i)->rate); + sbufWriteU16(dst, customServoMixers(i)->rate); sbufWriteU8(dst, customServoMixers(i)->speed); sbufWriteU8(dst, 0); sbufWriteU8(dst, 100); @@ -1810,10 +1810,10 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src) case MSP_SET_SERVO_MIX_RULE: sbufReadU8Safe(&tmp_u8, src); - if ((dataSize >= 8) && (tmp_u8 < MAX_SERVO_RULES)) { + if ((dataSize >= 9) && (tmp_u8 < MAX_SERVO_RULES)) { customServoMixersMutable(tmp_u8)->targetChannel = sbufReadU8(src); customServoMixersMutable(tmp_u8)->inputSource = sbufReadU8(src); - customServoMixersMutable(tmp_u8)->rate = sbufReadU8(src); + customServoMixersMutable(tmp_u8)->rate = sbufReadU16(src); customServoMixersMutable(tmp_u8)->speed = sbufReadU8(src); sbufReadU16(src); //Read 2bytes for min/max and ignore it sbufReadU8(src); //Read 1 byte for `box` and ignore it diff --git a/src/main/flight/servos.c b/src/main/flight/servos.c index 791323da9e..159c2e611b 100755 --- a/src/main/flight/servos.c +++ b/src/main/flight/servos.c @@ -231,8 +231,8 @@ void servoMixer(float dT) input[INPUT_FEATURE_FLAPS] = FLIGHT_MODE(FLAPERON) ? servoConfig()->flaperon_throw_offset : 0; if (IS_RC_MODE_ACTIVE(BOXCAMSTAB)) { - input[INPUT_GIMBAL_PITCH] = scaleRange(attitude.values.pitch, -1800, 1800, -1000, +1000); - input[INPUT_GIMBAL_ROLL] = scaleRange(attitude.values.roll, -1800, 1800, -1000, +1000); + input[INPUT_GIMBAL_PITCH] = scaleRange(attitude.values.pitch, -1800, 1800, -500, +500); + input[INPUT_GIMBAL_ROLL] = scaleRange(attitude.values.roll, -1800, 1800, -500, +500); } else { input[INPUT_GIMBAL_PITCH] = 0; input[INPUT_GIMBAL_ROLL] = 0; diff --git a/src/main/flight/servos.h b/src/main/flight/servos.h index 83bf790dbd..20f988acb4 100644 --- a/src/main/flight/servos.h +++ b/src/main/flight/servos.h @@ -91,7 +91,7 @@ typedef enum { typedef struct servoMixer_s { uint8_t targetChannel; // servo that receives the output of the rule uint8_t inputSource; // input channel for this rule - int8_t rate; // range [-125;+125] ; can be used to adjust a rate 0-125% and a direction + int16_t rate; // range [-1000;+1000] ; can be used to adjust a rate 0-1000% and a direction uint8_t speed; // reduces the speed of the rule, 0=unlimited speed } servoMixer_t;