mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 08:45:31 +03:00
Increase servo mix max rate (#4306)
This commit is contained in:
parent
1dbc1a452c
commit
7f6e45cb5b
4 changed files with 7 additions and 7 deletions
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue