1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Fix wrong test for BOXMSPOVERRIDE channel (#12857)

`msp_override_channels_mask` bits are indexed by raw channels, but
auxChannelIndex (starting from NON_AUX_CHANNEL_COUNT) was used for test

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
This commit is contained in:
Petr Ledvina 2023-06-10 09:07:36 +02:00 committed by GitHub
parent ee35b6afe3
commit 16776dc29f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -601,7 +601,7 @@ if (systemConfig()->configurationState == CONFIGURATION_STATE_DEFAULTS_BARE) {
for (int i = 0; i < MAX_MODE_ACTIVATION_CONDITION_COUNT; i++) {
const modeActivationCondition_t *mac = modeActivationConditions(i);
if (mac->modeId == BOXMSPOVERRIDE && ((1 << (mac->auxChannelIndex) & (rxConfig()->msp_override_channels_mask)))) {
if (mac->modeId == BOXMSPOVERRIDE && ((1 << (mac->auxChannelIndex + NON_AUX_CHANNEL_COUNT) & (rxConfig()->msp_override_channels_mask)))) {
rxConfigMutable()->msp_override_channels_mask &= ~(1 << (mac->auxChannelIndex + NON_AUX_CHANNEL_COUNT));
}
}