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

Added Logic AND to Modes

Added Mode Inversion configuration, CLI commands, and update.
Changed Mode Inversion to Mode Logic.
configure by AND/OR instead of output inversion.
Fixed Mode Logic code after debugging.
Added PG_REGISTER to cli unittest.
Revert version to previous.
Revamped Mode Logic using existing Conditions config.
Requires coordination with BF-configurator, but works with CLI (added argument in 'aux' command).
Coding standard changes.
Cleaned up code. Added modeLogic enum.
removed executable permissions.
Code cleanup, cliAux backward compatible.
changed bitArrayInv to bitArrayXor.
allow for old 'aux' command (without last argument) to be made. asserts MODELOGIC_OR instead of resetting the memory.
This commit is contained in:
Dave Huber 2017-12-06 23:12:59 -06:00
parent 625f083a3f
commit b9272ae325
5 changed files with 60 additions and 20 deletions

View file

@ -65,6 +65,11 @@ typedef enum {
CHECKBOX_ITEM_COUNT
} boxId_e;
typedef enum {
MODELOGIC_OR = 0,
MODELOGIC_AND
} modeLogic_e;
// type to hold enough bits for CHECKBOX_ITEM_COUNT. Struct used for value-like behavior
typedef struct boxBitmask_s { uint32_t bits[(CHECKBOX_ITEM_COUNT + 31) / 32]; } boxBitmask_t;
@ -82,7 +87,7 @@ typedef struct boxBitmask_s { uint32_t bits[(CHECKBOX_ITEM_COUNT + 31) / 32]; }
// steps are 25 apart
// a value of 0 corresponds to a channel value of 900 or less
// a value of 48 corresponds to a channel value of 2100 or more
// 48 steps between 900 and 1200
// 48 steps between 900 and 2100
typedef struct channelRange_s {
uint8_t startStep;
uint8_t endStep;
@ -92,6 +97,7 @@ typedef struct modeActivationCondition_s {
boxId_e modeId;
uint8_t auxChannelIndex;
channelRange_t range;
modeLogic_e modeLogic;
} modeActivationCondition_t;
PG_DECLARE_ARRAY(modeActivationCondition_t, MAX_MODE_ACTIVATION_CONDITION_COUNT, modeActivationConditions);