config blink FIX

This commit is contained in:
Patrick Haßel 2023-01-03 15:00:23 +01:00
parent a039947e13
commit 617822b493
4 changed files with 15 additions and 4 deletions

View File

@ -30,18 +30,21 @@ void config_set_dirty() {
}
void config_loop() {
if (notify && millis() - lastDirtyMillis <= WRITE_DELAY_MS + 1000) {
if (notify && millis() - lastDirtyMillis > WRITE_DELAY_MS + 2000) {
notify = false;
display.set(0, 0, RED);
}
if (notify) {
bool blink = ((millis() - lastDirtyMillis) / 100) % 2 == 0;
display.set(0, 0, blink ? MAGENTA : BLACK);
}
if (!dirty) {
return;
}
if (millis() - lastDirtyMillis <= 30000) {
return;
}
dirty = false;
notify = true;

View File

@ -12,6 +12,10 @@ const Color BLUE = {____, ____, FULL};
const Color YELLOW = {FULL, FULL, ____};
const Color MAGENTA = {FULL, ____, FULL};
const Color TURQUOISE = {____, FULL, FULL};
Color gray(uint8_t brightness) {
return {brightness, brightness, brightness};
}

View File

@ -25,4 +25,8 @@ extern const Color BLUE;
extern const Color YELLOW;
extern const Color MAGENTA;
extern const Color TURQUOISE;
#endif

View File

@ -22,9 +22,9 @@ void setup() {
void loop() {
serial_loop();
config_loop();
wifi_loop();
server_loop();
mode_loop();
config_loop();
display.loop();
}