Allow inflight adjustment of yaw rate.

This commit is contained in:
Dominic Clifton 2014-10-24 22:01:31 +01:00
parent 9ddbb4ed9d
commit f166ca3516
2 changed files with 10 additions and 1 deletions

View File

@ -275,6 +275,10 @@ static const adjustmentConfig_t defaultAdjustmentConfigs[ADJUSTMENT_FUNCTION_COU
{ {
.adjustmentFunction = ADJUSTMENT_PITCH_ROLL_RATE, .adjustmentFunction = ADJUSTMENT_PITCH_ROLL_RATE,
.step = 1 .step = 1
},
{
.adjustmentFunction = ADJUSTMENT_YAW_RATE,
.step = 1
} }
}; };
@ -329,6 +333,10 @@ void applyAdjustment(controlRateConfig_t *controlRateConfig, uint8_t adjustmentF
newValue = (int)controlRateConfig->rollPitchRate + delta; newValue = (int)controlRateConfig->rollPitchRate + delta;
controlRateConfig->rollPitchRate = constrain(newValue, 0, 100); // FIXME magic numbers repeated in serial_cli.c controlRateConfig->rollPitchRate = constrain(newValue, 0, 100); // FIXME magic numbers repeated in serial_cli.c
break; break;
case ADJUSTMENT_YAW_RATE:
newValue = (int)controlRateConfig->yawRate + delta;
controlRateConfig->yawRate = constrain(newValue, 0, 100); // FIXME magic numbers repeated in serial_cli.c
break;
default: default:
break; break;
}; };

View File

@ -138,9 +138,10 @@ typedef enum {
ADJUSTMENT_RC_RATE, ADJUSTMENT_RC_RATE,
ADJUSTMENT_RC_EXPO, ADJUSTMENT_RC_EXPO,
ADJUSTMENT_PITCH_ROLL_RATE, ADJUSTMENT_PITCH_ROLL_RATE,
ADJUSTMENT_YAW_RATE,
} adjustmentFunction_e; } adjustmentFunction_e;
#define ADJUSTMENT_FUNCTION_COUNT 4 #define ADJUSTMENT_FUNCTION_COUNT 5
typedef struct adjustmentConfig_s { typedef struct adjustmentConfig_s {
uint8_t adjustmentFunction; uint8_t adjustmentFunction;