mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Recive commands and config from server Send raw calibration data on calibration command, send config data on config command Refactor some code
22 lines
427 B
C++
22 lines
427 B
C++
#include <EEPROM.h>
|
|
#include "configuration.h"
|
|
|
|
void initializeConfig() {
|
|
EEPROM.begin(sizeof(DeviceConfig) + 1);
|
|
}
|
|
|
|
bool hasConfigStored() {
|
|
bool hasConfigStored = false;
|
|
EEPROM.get(0, hasConfigStored);
|
|
return hasConfigStored;
|
|
}
|
|
|
|
void loadConfig(DeviceConfig * cfg) {
|
|
EEPROM.get(1, cfg);
|
|
}
|
|
|
|
void saveConfig(DeviceConfig * const cfg) {
|
|
EEPROM.put(0, true);
|
|
EEPROM.put(1, cfg);
|
|
EEPROM.commit();
|
|
} |