1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Allow inflight adjustment of pitch/roll rate.

This commit is contained in:
Dominic Clifton 2014-10-24 21:49:46 +01:00
parent a406cb6f96
commit 81e3425326
2 changed files with 12 additions and 2 deletions

View file

@ -267,7 +267,12 @@ static const adjustmentConfig_t defaultAdjustmentConfigs[ADJUSTMENT_FUNCTION_COU
{ {
.adjustmentFunction = ADJUSTMENT_RC_RATE, .adjustmentFunction = ADJUSTMENT_RC_RATE,
.step = 1 .step = 1
},
{
.adjustmentFunction = ADJUSTMENT_PITCH_ROLL_RATE,
.step = 1
} }
}; };
#define ADJUSTMENT_FUNCTION_CONFIG_INDEX_OFFSET 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 controlRateConfig->rcRate8 = constrain(newValue, 0, 250); // FIXME magic numbers repeated in serial_cli.c
generatePitchRollCurve(controlRateConfig); generatePitchRollCurve(controlRateConfig);
break; 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: default:
break; break;
}; };

View file

@ -135,10 +135,11 @@ void updateActivatedModes(modeActivationCondition_t *modeActivationConditions);
typedef enum { typedef enum {
ADJUSTMENT_NONE = 0, ADJUSTMENT_NONE = 0,
ADJUSTMENT_RC_RATE ADJUSTMENT_RC_RATE,
ADJUSTMENT_PITCH_ROLL_RATE
} adjustmentFunction_e; } adjustmentFunction_e;
#define ADJUSTMENT_FUNCTION_COUNT 2 #define ADJUSTMENT_FUNCTION_COUNT 3
typedef struct adjustmentConfig_s { typedef struct adjustmentConfig_s {
uint8_t adjustmentFunction; uint8_t adjustmentFunction;