[Companion] Fix startup switch warnings wraparound issue with X9E SQ-SR switches (closes #3359).
This commit is contained in:
@@ -1161,7 +1161,7 @@ void SetupPanel::updateStartupSwitches()
|
|||||||
int index = slider->property("index").toInt();
|
int index = slider->property("index").toInt();
|
||||||
bool enabled = !(model->switchWarningEnable & (1 << index));
|
bool enabled = !(model->switchWarningEnable & (1 << index));
|
||||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
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) {
|
if (generalSettings.switchConfig[index] != Board::SWITCH_3POS && value == 2) {
|
||||||
value = 1;
|
value = 1;
|
||||||
}
|
}
|
||||||
@@ -1187,7 +1187,7 @@ void SetupPanel::startupSwitchEdited(int value)
|
|||||||
|
|
||||||
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
if (IS_HORUS_OR_TARANIS(firmware->getBoard())) {
|
||||||
shift = index * 2;
|
shift = index * 2;
|
||||||
mask = 0x03ul << shift;
|
mask = 0x03ull << shift;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user