Allow inflight adjustment of pitch/roll rate.
This commit is contained in:
parent
a406cb6f96
commit
81e3425326
|
@ -267,7 +267,12 @@ static const adjustmentConfig_t defaultAdjustmentConfigs[ADJUSTMENT_FUNCTION_COU
|
|||
{
|
||||
.adjustmentFunction = ADJUSTMENT_RC_RATE,
|
||||
.step = 1
|
||||
},
|
||||
{
|
||||
.adjustmentFunction = ADJUSTMENT_PITCH_ROLL_RATE,
|
||||
.step = 1
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#define ADJUSTMENT_FUNCTION_CONFIG_INDEX_OFFSET 1
|
||||
|
@ -311,6 +316,10 @@ void applyAdjustment(controlRateConfig_t *controlRateConfig, uint8_t adjustmentF
|
|||
controlRateConfig->rcRate8 = constrain(newValue, 0, 250); // FIXME magic numbers repeated in serial_cli.c
|
||||
generatePitchRollCurve(controlRateConfig);
|
||||
break;
|
||||
case ADJUSTMENT_PITCH_ROLL_RATE:
|
||||
newValue = (int)controlRateConfig->rollPitchRate + delta;
|
||||
controlRateConfig->rollPitchRate = constrain(newValue, 0, 100); // FIXME magic numbers repeated in serial_cli.c
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
|
|
@ -135,10 +135,11 @@ void updateActivatedModes(modeActivationCondition_t *modeActivationConditions);
|
|||
|
||||
typedef enum {
|
||||
ADJUSTMENT_NONE = 0,
|
||||
ADJUSTMENT_RC_RATE
|
||||
ADJUSTMENT_RC_RATE,
|
||||
ADJUSTMENT_PITCH_ROLL_RATE
|
||||
} adjustmentFunction_e;
|
||||
|
||||
#define ADJUSTMENT_FUNCTION_COUNT 2
|
||||
#define ADJUSTMENT_FUNCTION_COUNT 3
|
||||
|
||||
typedef struct adjustmentConfig_s {
|
||||
uint8_t adjustmentFunction;
|
||||
|
|
Loading…
Reference in New Issue