[Companion] Fix startup switch warnings wraparound issue with X9E SQ-SR switches (closes #3359).

This commit is contained in:
Max Paperno
2017-04-11 12:07:09 -04:00
parent 95b31ee147
commit de3c503e02
+2 -2
View File
@@ -1161,7 +1161,7 @@ void SetupPanel::updateStartupSwitches()
int index = slider->property("index").toInt();
bool enabled = !(model->switchWarningEnable & (1 << index));
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
value = (switchStates >> 2*index) & 0x03;
value = (switchStates >> (2*index)) & 0x03;
if (generalSettings.switchConfig[index] != Board::SWITCH_3POS && value == 2) {
value = 1;
}
@@ -1187,7 +1187,7 @@ void SetupPanel::startupSwitchEdited(int value)
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
shift = index * 2;
mask = 0x03ul << shift;
mask = 0x03ull << shift;
}
else {
if (index == 0) {