mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Add FPV ANGLE MIX as a mode
ident
This commit is contained in:
parent
6582a958aa
commit
5e32ced94d
3 changed files with 5 additions and 1 deletions
|
@ -50,6 +50,7 @@ typedef enum {
|
||||||
BOXFAILSAFE,
|
BOXFAILSAFE,
|
||||||
BOXAIRMODE,
|
BOXAIRMODE,
|
||||||
BOX3DDISABLESWITCH,
|
BOX3DDISABLESWITCH,
|
||||||
|
BOXFPVANGLEMIX,
|
||||||
CHECKBOX_ITEM_COUNT
|
CHECKBOX_ITEM_COUNT
|
||||||
} boxId_e;
|
} boxId_e;
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
|
||||||
{ BOXFAILSAFE, "FAILSAFE;", 27 },
|
{ BOXFAILSAFE, "FAILSAFE;", 27 },
|
||||||
{ BOXAIRMODE, "AIR MODE;", 28 },
|
{ BOXAIRMODE, "AIR MODE;", 28 },
|
||||||
{ BOX3DDISABLESWITCH, "DISABLE 3D SWITCH;", 29},
|
{ BOX3DDISABLESWITCH, "DISABLE 3D SWITCH;", 29},
|
||||||
|
{ BOXFPVANGLEMIX, "FPV ANGLE MIX;", 30},
|
||||||
{ CHECKBOX_ITEM_COUNT, NULL, 0xFF }
|
{ CHECKBOX_ITEM_COUNT, NULL, 0xFF }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -474,6 +475,8 @@ void mspInit(serialConfig_t *serialConfig)
|
||||||
if (!feature(FEATURE_AIRMODE)) activeBoxIds[activeBoxIdCount++] = BOXAIRMODE;
|
if (!feature(FEATURE_AIRMODE)) activeBoxIds[activeBoxIdCount++] = BOXAIRMODE;
|
||||||
activeBoxIds[activeBoxIdCount++] = BOX3DDISABLESWITCH;
|
activeBoxIds[activeBoxIdCount++] = BOX3DDISABLESWITCH;
|
||||||
|
|
||||||
|
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
|
||||||
|
|
||||||
if (sensors(SENSOR_BARO)) {
|
if (sensors(SENSOR_BARO)) {
|
||||||
activeBoxIds[activeBoxIdCount++] = BOXBARO;
|
activeBoxIds[activeBoxIdCount++] = BOXBARO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@ void processRcCommand(void)
|
||||||
for (axis = 0; axis < 3; axis++) angleRate[axis] = calculateRate(axis, rcCommand[axis]);
|
for (axis = 0; axis < 3; axis++) angleRate[axis] = calculateRate(axis, rcCommand[axis]);
|
||||||
|
|
||||||
// Scaling of AngleRate to camera angle (Mixing Roll and Yaw)
|
// Scaling of AngleRate to camera angle (Mixing Roll and Yaw)
|
||||||
if (masterConfig.rxConfig.fpvCamAngleDegrees && !FLIGHT_MODE(HEADFREE_MODE)) {
|
if (masterConfig.rxConfig.fpvCamAngleDegrees && IS_RC_MODE_ACTIVE(BOXFPVANGLEMIX) && !FLIGHT_MODE(HEADFREE_MODE)) {
|
||||||
scaleRcCommandToFpvCamAngle();
|
scaleRcCommandToFpvCamAngle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue