If the code hasn't been touched in this long, its probably release-worthy.

This commit is contained in:
2022-06-11 11:02:27 +02:00
parent 0c9eb831dd
commit d14fa7fde1
59 changed files with 1610 additions and 842 deletions

View File

@@ -8,9 +8,13 @@ constexpr uint16_t HardwareConfig::MAX_LED_NUM;
HardwareConfig
HardwareConfig::load() {
HardwareConfig ret;
#ifndef BOARD_TEENSY
EEPROM.begin(sizeof(ret));
#endif
EEPROM.get(0, ret);
#ifndef BOARD_TEENSY
EEPROM.end();
#endif
Log.notice("Loaded config version %d, CRC %d", ret.version, ret.checksum);
return ret;
}
@@ -19,10 +23,14 @@ void
HardwareConfig::save() {
HardwareConfig dataCopy{*this};
dataCopy.checksum = getCRC();
#ifndef BOARD_TEENSY
EEPROM.begin(sizeof(dataCopy));
#endif
EEPROM.put(0, dataCopy);
#ifndef BOARD_TEENSY
EEPROM.commit();
EEPROM.end();
#endif
}
LinearCoordinateMapping
@@ -72,13 +80,6 @@ ConfigService::onStart()
m_coordMap = m_config.toCoordMap();
Log.notice("Configured to use %d pixels, starting at %d", m_config.data.pixelCount, m_config.data.startPixel);
/*Log.notice("Loading task states...");
for(int i = 0; i < 32; i++) {
auto svc = m_config.data.serviceStates[i];
if (strnlen(svc.name, 16) > 0) {
Log.notice("* %s: %s", svc.name, svc.isDisabled? "DISABLED" : "ENABLED");
}
}*/
}
void
@@ -112,3 +113,4 @@ ConfigService::handleEvent(const InputEvent &evt)
}
STATIC_ALLOC(ConfigService);
STATIC_TASK(ConfigService);