Added configuration handling

This commit is contained in:
Thomas Basler
2022-04-10 16:57:24 +02:00
parent 893bd0c0d4
commit 8b7f2a14b6
3 changed files with 96 additions and 0 deletions

22
include/Configuration.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include <Arduino.h>
#define CONFIG_FILENAME "/config.bin"
#define CONFIG_VERSION 0x00010000 // 0.1.0
struct CONFIG_T {
uint32_t Cfg_Version;
uint Cfg_SaveCount;
};
class ConfigurationClass {
public:
void init();
bool read();
bool write();
void migrate();
CONFIG_T& get();
};
extern ConfigurationClass Configuration;