added support for min/max contrast to eeprom interface and use it (#5473)

Added support for min/max contrast to eeprom interface and use it. Fixes #5468
This commit is contained in:
Raphael Coeffic
2017-12-07 22:10:24 +01:00
committed by Bertrand Songis
parent 81dbebb663
commit 934578118b
4 changed files with 25 additions and 1 deletions
+3 -1
View File
@@ -31,7 +31,6 @@ ui(new Ui::GeneralSetup)
QSlider *tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL};
if (IS_TARANIS(firmware->getBoard())) {
ui->contrastSB->setMinimum(0);
if (firmware->getId().contains("readonly")) {
uint16_t switchstate = generalSettings.switchUnlockStates;
ui->chkSA->setValue(switchstate & 0x3);
@@ -216,7 +215,10 @@ ui(new Ui::GeneralSetup)
populateRotEncCB(reCount);
}
ui->contrastSB->setMinimum(firmware->getCapability(MinContrast));
ui->contrastSB->setMaximum(firmware->getCapability(MaxContrast));
ui->contrastSB->setValue(generalSettings.contrast);
ui->battwarningDSB->setValue((double)generalSettings.vBatWarn/10);
ui->backlightautoSB->setValue(generalSettings.backlightDelay*5);
ui->inactimerSB->setValue(generalSettings.inactivityTimer);