fix(cpn): binary import of multipos switches (#5169)

This commit is contained in:
Neil Horne
2024-06-13 08:34:56 +10:00
committed by GitHub
parent a6dfccddb7
commit b644aadbaa
@@ -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++);
}
}