1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Allow linking of modes

This allows modes to be linked, for example to link vtx pit mode to paralyze. Whenever paralyze is activated, vtx pit mode is activated as well. Also the logic to prevent mode changes when enabling paralyze can be removed in favor of making paralyze sticky.

Modes can be linked in CLI by providing the mode id as the last parameter of the aux command. For example in order to link vtx pit mode to paralyze, replace the last 0 of the pit mode aux (39) with the mode id of paralyze (45):

```
aux 2 39 2 1700 2100 0 0
```

becomes

```
aux 2 39 2 1700 2100 0 45
```

_Legal disclaimer: I am making my contributions/submissions to this project solely in my personal capacity and am not conveying any rights to any intellectual property of any third parties._
This commit is contained in:
Robert Lacroix 2018-07-11 12:04:11 +02:00
parent ac2f39a10c
commit aa18ab4afa
7 changed files with 130 additions and 58 deletions

View file

@ -117,6 +117,7 @@ typedef struct modeActivationCondition_s {
uint8_t auxChannelIndex;
channelRange_t range;
modeLogic_e modeLogic;
boxId_e linkedTo;
} modeActivationCondition_t;
PG_DECLARE_ARRAY(modeActivationCondition_t, MAX_MODE_ACTIVATION_CONDITION_COUNT, modeActivationConditions);
@ -129,7 +130,6 @@ typedef struct modeActivationProfile_s {
bool IS_RC_MODE_ACTIVE(boxId_e boxId);
void rcModeUpdate(boxBitmask_t *newState);
void preventModeChanges(void);
bool isAirmodeActive(void);
bool isAntiGravityModeActive(void);