color cleanup and brightness

This commit is contained in:
2024-05-19 21:42:39 +02:00
parent 7894359f30
commit d9fd18d799
8 changed files with 126 additions and 97 deletions

View File

@ -3,7 +3,7 @@
#include "spi.h"
#define MAGIC 0xafff
#define MAGIC 0xb000
#define HIGHSCORE_ADDR 0x00
#define DUMMY 0x00
#define CMD_READ 0b00000011
@ -16,6 +16,7 @@ typedef struct {
uint16_t magic;
uint16_t highScore;
uint8_t flashColor;
uint8_t brightness;
} t_configBlock;
typedef union {
@ -59,6 +60,7 @@ void eepromInit() {
buf.v.magic = MAGIC;
buf.v.highScore = 0;
buf.v.flashColor = 0;
buf.v.brightness = 0;
writeBuf();
}
}
@ -84,3 +86,11 @@ void eepromSetFlashColor(uint8_t v) {
buf.v.flashColor = v;
}
uint8_t eepromReadBrightness() {
return buf.v.brightness;
}
void eepromSetBrightness(uint8_t v) {
buf.v.brightness = v;
}