This commit is contained in:
Wolfgang Hottgenroth 2024-05-19 22:06:21 +02:00
parent ebb0f5846d
commit 1cbba5c8b3
2 changed files with 9 additions and 5 deletions

View File

@ -12,14 +12,17 @@
static bool configChanged = false;
static void configHandleFlash() {
uint8_t color = eepromReadFlashColor();
canvasFillRow(CANVAS_HEIGHT-1, color);
displaySetValue(color);
if (buttonsConfig2Pressed()) {
configChanged = true;
uint8_t color = eepromReadFlashColor() + 1;
color += 1;
if (color > _color_end) {
color = 0;
}
canvasFillRow(CANVAS_HEIGHT-1, color);
displaySetValue(color);
eepromSetFlashColor(color);
}
}
@ -73,13 +76,13 @@ void configExec(void *handle) {
configHandler[configState]();
if (configChanged) {
miniCanvasSetPixel(0, 2, _red);
miniCanvasSetPixel(0, 3, _red);
if (buttonsConfig4Pressed()) {
eepromCommit();
configChanged = false;
}
} else {
miniCanvasSetPixel(0, 2, _green);
miniCanvasSetPixel(0, 3, _green);
}
canvasShow();

View File

@ -1,4 +1,5 @@
#include <stdint.h>
#include <string.h>
#include "eeprom.h"
#include "spi.h"