cleanup main.cpp, split platform code into a Platform object
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
#include "./Config.h"
|
||||
#include "./Static.h"
|
||||
#include <ArduinoLog.h>
|
||||
#include <EEPROM.h>
|
||||
|
||||
constexpr uint16_t HardwareConfig::MAX_LED_NUM;
|
||||
|
||||
HardwareConfig
|
||||
HardwareConfig::load() {
|
||||
HardwareConfig ret;
|
||||
#ifdef PLATFORM_PHOTON
|
||||
EEPROM.get(0, ret);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -17,9 +16,7 @@ void
|
||||
HardwareConfig::save() {
|
||||
HardwareConfig dataCopy{*this};
|
||||
dataCopy.checksum = getCRC();
|
||||
#ifdef PLATFORM_PHOTON
|
||||
EEPROM.put(0, dataCopy);
|
||||
#endif
|
||||
}
|
||||
|
||||
LinearCoordinateMapping
|
||||
@@ -103,6 +100,8 @@ ConfigService::handleEvent(const InputEvent &evt)
|
||||
//Log.info("Saving configuration");
|
||||
m_config.save();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user