1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Mask BOXARM in MSP enables

This commit is contained in:
Dave Huber 2017-12-18 10:52:38 -06:00
parent b94533ead1
commit 5048c74130

View file

@ -286,6 +286,7 @@ int packFlightModeFlags(boxBitmask_t *mspFlightModeFlags)
// copy ARM state
if (ARMING_FLAG(ARMED)) {
bitArraySet(&boxEnabledMask, BOXARM);
bitArraySet(&boxFlightModeMask, BOXARM);
}
// enable BOXes dependent on FLIGHT_MODE, use mapping table (from runtime_config.h)
@ -304,7 +305,7 @@ int packFlightModeFlags(boxBitmask_t *mspFlightModeFlags)
// only subset of BOXes depend on rcMode (non-ARM or FLIGHT_MODE), use mask to select them
// NOTE: ARM and FLIGHT modes are potentially contingent on other conditions.
// Therefore, they must be masked/enabled separately from simple "range conditions" (RC)
for (unsigned i = 1; i < CHECKBOX_ITEM_COUNT; i++) { // skip BOXARM
for (unsigned i = 0; i < CHECKBOX_ITEM_COUNT; i++) {
if (!bitArrayGet(&boxFlightModeMask, i) && IS_RC_MODE_ACTIVE(i))
bitArraySet(&boxEnabledMask, i);
}