Skip to content

Commit

Permalink
fix(cpn): binary import of multipos switches (#5169)
Browse files Browse the repository at this point in the history
  • Loading branch information
elecpower authored Jun 12, 2024
1 parent a6dfccd commit b644aad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions companion/src/firmwares/opentx/opentxeeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,10 @@ class SwitchesConversionTable: public ConversionTable {
}

if (IS_HORUS_OR_TARANIS(board)) {
const int adc_offset = 4 * 6; // num sticks * multi pot posns as adc assumes ALL inputs can be multi pos
for (int i=1; i<=MAX_XPOTS(board, version)*6; i++) {
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++);
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i - adc_offset), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i + adc_offset), val++);
}
}

Expand Down

0 comments on commit b644aad

Please sign in to comment.