mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Fix settings bug
This commit is contained in:
@@ -139,7 +139,7 @@ uint16_t getSettingValue(const enum SettingsOptions option) { return systemSetti
|
||||
|
||||
bool nextSettingValue(const enum SettingsOptions option) {
|
||||
const auto constants = settingsConstants[(int)option];
|
||||
if (systemSettings.settingsValues[(int)option] == (constants.max - constants.increment)) {
|
||||
if (systemSettings.settingsValues[(int)option] >= (constants.max - constants.increment)) {
|
||||
systemSettings.settingsValues[(int)option] = constants.min;
|
||||
} else {
|
||||
systemSettings.settingsValues[(int)option] += constants.increment;
|
||||
@@ -150,7 +150,7 @@ bool nextSettingValue(const enum SettingsOptions option) {
|
||||
bool prevSettingValue(const enum SettingsOptions option) {
|
||||
const auto constants = settingsConstants[(int)option];
|
||||
int value = systemSettings.settingsValues[(int)option];
|
||||
if (value == constants.min) {
|
||||
if (value <= constants.min) {
|
||||
value = constants.max;
|
||||
} else {
|
||||
value -= constants.increment;
|
||||
|
||||
@@ -787,6 +787,7 @@ static bool settings_displayBrightnessLevel(void) {
|
||||
OLED::drawArea(0, 0, 16, 16, brightnessIcon);
|
||||
OLED::setCursor(5 * FONT_12_WIDTH - 2, 0);
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::OLEDContrast), 3, FontStyle::LARGE);
|
||||
OLED::setContrast(getSettingValue(SettingsOptions::OLEDContrast));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -794,6 +795,7 @@ static bool settings_displayInvertColor(void) {
|
||||
OLED::drawArea(0, 0, 24, 16, invertDisplayIcon);
|
||||
OLED::setCursor(7 * FONT_12_WIDTH - 2, 0);
|
||||
OLED::drawCheckbox(getSettingValue(SettingsOptions::OLEDInversion));
|
||||
OLED::setInverseDisplay(getSettingValue(SettingsOptions::OLEDInversion));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user