fix half transition

fix static words not displayed after transition mode change
This commit is contained in:
lukas 2022-02-01 14:46:43 +01:00
parent 3c22de49c7
commit 4b7553246d
2 changed files with 8 additions and 8 deletions

View File

@ -72,10 +72,13 @@ void Clock::refreshTime() {
const uint8_t minute = loctime->tm_min;
// enable night brighntess at 21' and disable it at 6'
if (hour >= 22 || hour <= 6) {
strip.setBrightness(NIGHTBRIGHTNESS);
} else {
strip.setBrightness(DAYBRIGHTNESS);
bool daybrightness = !(hour >= 22 || hour <= 6);
if (oldDayBrightness != daybrightness) {
strip.setBrightness(daybrightness ? DAYBRIGHTNESS : NIGHTBRIGHTNESS);
paintAlwaysOnLeds();
oldDayBrightness = daybrightness;
}
setTime(hour, minute, this->twentyAfterSyntax, this->clockAlwaysOn);
@ -116,7 +119,6 @@ void Clock::setTime(uint8_t hour, uint8_t minute, bool twas, bool alwaysClockWor
oldhourWord = hourWord;
}
// printWord(hourWord, Adafruit_NeoPixel::Color(0, 255, 255));
// print the minute words and the corresponding after/before half words
printMinutes(minuteselector, twas);
@ -150,8 +152,6 @@ void Clock::printMinutes(uint8_t minuteSelector, bool twas) {
minuteWord = types::viertel;
else if (minuteSelector == 9)
minuteWord = types::dreiviertel;
else if (minuteSelector == 6)
minuteWord = types::halb;
if (oldminuteWord != minuteWord) {
addque.push_back(Word(minuteWord, 0x00FF00));

View File

@ -30,7 +30,7 @@ class Clock {
std::vector<Word> addque;
std::vector<uint8_t> oldminuteWord, oldvornachWord, oldhourWord;
bool oldhalfActive, oldUhrActive;
bool oldhalfActive, oldUhrActive, oldDayBrightness;
bool twentyAfterSyntax;
bool clockAlwaysOn;