-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LED bar flickers #138
Fix LED bar flickers #138
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -462,6 +462,7 @@ static void ledBarEnabledUpdate(void) { | |
ag->ledBar.setBrighness(brightness); | ||
ag->ledBar.setEnable(configuration.getLedBarMode() != LedBarModeOff); | ||
} | ||
ag->ledBar.show(); | ||
} | ||
} | ||
|
||
|
@@ -804,10 +805,6 @@ static void configUpdateHandle() { | |
return; | ||
} | ||
|
||
if (ag->isOne()) { | ||
ledBarEnabledUpdate(); | ||
stateMachine.executeLedBarTest(); | ||
} | ||
stateMachine.executeCo2Calibration(); | ||
|
||
String mqttUri = configuration.getMqttBrokerUri(); | ||
|
@@ -843,15 +840,42 @@ static void configUpdateHandle() { | |
|
||
if (ag->isOne()) { | ||
if (configuration.isLedBarBrightnessChanged()) { | ||
ag->ledBar.setBrighness(configuration.getLedBarBrightness()); | ||
Serial.println("Set 'LedBarBrightness' brightness: " + | ||
if (configuration.getLedBarBrightness() == 0) { | ||
ag->ledBar.setEnable(false); | ||
} else { | ||
if (configuration.getLedBarMode() != LedBarMode::LedBarModeOff) { | ||
ag->ledBar.setEnable(true); | ||
} | ||
ag->ledBar.setBrighness(configuration.getLedBarBrightness()); | ||
} | ||
ag->ledBar.show(); | ||
Serial.println("Set 'ledBarBrightness' brightness: " + | ||
String(configuration.getLedBarBrightness())); | ||
} | ||
|
||
if (configuration.isLedBarModeChanged()) { | ||
Serial.println("Set 'ledBarMode' " + String(configuration.getLedBarMode())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we do not really "set" the ledBarMode then later on? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'll remove it. It's just for test. |
||
Serial.println("Get 'ledBarBrightness' " + String(configuration.getLedBarBrightness())); | ||
if (configuration.getLedBarBrightness() == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the code is redundant to what we have on line 843 onwards? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes a bit of same. at 843: focus to set brightness |
||
ag->ledBar.setEnable(false); | ||
} else { | ||
if(configuration.getLedBarMode() == LedBarMode::LedBarModeOff) { | ||
ag->ledBar.setEnable(false); | ||
} else { | ||
ag->ledBar.setEnable(true); | ||
ag->ledBar.setBrighness(configuration.getLedBarBrightness()); | ||
} | ||
} | ||
ag->ledBar.show(); | ||
} | ||
|
||
if (configuration.isDisplayBrightnessChanged()) { | ||
oledDisplay.setBrightness(configuration.getDisplayBrightness()); | ||
Serial.println("Set 'DisplayBrightness' brightness: " + | ||
String(configuration.getDisplayBrightness())); | ||
} | ||
|
||
stateMachine.executeLedBarTest(); | ||
} | ||
|
||
fwNewVersion = configuration.newFirmwareVersion(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setBrighness -> setBrightness