Compare commits

...

1 Commits

Author SHA1 Message Date
06bbd7a874 Upravy pro ArduinoJson 7 (>= 7.0.3) 2024-02-06 17:20:23 +01:00

View File

@@ -24,10 +24,6 @@ enum {
#define SYSVAR_FILE "/cfg.json" #define SYSVAR_FILE "/cfg.json"
#endif #endif
#if not defined(SYSVAR_DOCUMENT_SIZE)
#define SYSVAR_DOCUMENT_SIZE (4096)
#endif
/** /**
* @brief Get value * @brief Get value
* *
@@ -43,7 +39,7 @@ T svGetV(const String & name, int * result = nullptr)
{ {
T rv{}; T rv{};
int res; int res;
DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); JsonDocument doc;
File f; File f;
f = USEDFS.open(F(SYSVAR_FILE), "r"); f = USEDFS.open(F(SYSVAR_FILE), "r");
@@ -83,7 +79,7 @@ T svGetV(const String & name, int * result, const String & fname)
{ {
T rv{}; T rv{};
int res; int res;
DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); JsonDocument doc;
File f; File f;
f = USEDFS.open(fname, "r"); f = USEDFS.open(fname, "r");
@@ -121,7 +117,7 @@ template <typename T>
int svSetV(const String & name, T value) int svSetV(const String & name, T value)
{ {
int res; int res;
DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); JsonDocument doc;
File f; File f;
f = USEDFS.open(F(SYSVAR_FILE), "r"); f = USEDFS.open(F(SYSVAR_FILE), "r");
@@ -159,7 +155,7 @@ template <typename T>
int svSetV(const String & name, T value, const String & fname) int svSetV(const String & name, T value, const String & fname)
{ {
int res = SV_UNSPECIFIED_ERROR; int res = SV_UNSPECIFIED_ERROR;
DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); JsonDocument doc;
File f; File f;
f = USEDFS.open(fname, "r"); f = USEDFS.open(fname, "r");