config blink FIX
This commit is contained in:
parent
a039947e13
commit
617822b493
@ -30,18 +30,21 @@ void config_set_dirty() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void config_loop() {
|
void config_loop() {
|
||||||
if (notify && millis() - lastDirtyMillis <= WRITE_DELAY_MS + 1000) {
|
if (notify && millis() - lastDirtyMillis > WRITE_DELAY_MS + 2000) {
|
||||||
notify = false;
|
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) {
|
if (!dirty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (millis() - lastDirtyMillis <= 30000) {
|
if (millis() - lastDirtyMillis <= 30000) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dirty = false;
|
dirty = false;
|
||||||
notify = true;
|
notify = true;
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,10 @@ const Color BLUE = {____, ____, FULL};
|
|||||||
|
|
||||||
const Color YELLOW = {FULL, FULL, ____};
|
const Color YELLOW = {FULL, FULL, ____};
|
||||||
|
|
||||||
|
const Color MAGENTA = {FULL, ____, FULL};
|
||||||
|
|
||||||
|
const Color TURQUOISE = {____, FULL, FULL};
|
||||||
|
|
||||||
Color gray(uint8_t brightness) {
|
Color gray(uint8_t brightness) {
|
||||||
return {brightness, brightness, brightness};
|
return {brightness, brightness, brightness};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,4 +25,8 @@ extern const Color BLUE;
|
|||||||
|
|
||||||
extern const Color YELLOW;
|
extern const Color YELLOW;
|
||||||
|
|
||||||
|
extern const Color MAGENTA;
|
||||||
|
|
||||||
|
extern const Color TURQUOISE;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -22,9 +22,9 @@ void setup() {
|
|||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
serial_loop();
|
serial_loop();
|
||||||
config_loop();
|
|
||||||
wifi_loop();
|
wifi_loop();
|
||||||
server_loop();
|
server_loop();
|
||||||
mode_loop();
|
mode_loop();
|
||||||
|
config_loop();
|
||||||
display.loop();
|
display.loop();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user