Fixes #3459 Rotary encoders linked flight mode can freeze Companion (#3470)

This commit is contained in:
Neil Horne
2016-05-14 20:18:17 +02:00
committed by Bertrand Songis
parent 721a166be3
commit 98798c1e42
+3 -2
View File
@@ -229,8 +229,9 @@ void FlightModePanel::update()
int idx = phase.rotaryEncoders[i];
FlightModeData *phasere = &phase;
while (idx > 1024) {
idx -= 1025;
phasere = &model->flightModeData[idx];
int nextPhase = idx - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phasere = &model->flightModeData[nextPhase];
idx = phasere->rotaryEncoders[i];
reValues[i]->setDisabled(true);
}