From 06bbd7a87467a52bea171a9a1d16b816c2810ecb Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Tue, 6 Feb 2024 17:20:23 +0100 Subject: [PATCH] Upravy pro ArduinoJson 7 (>= 7.0.3) --- src/sysvars.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/sysvars.hpp b/src/sysvars.hpp index 5dd5eb9..c1f1d12 100644 --- a/src/sysvars.hpp +++ b/src/sysvars.hpp @@ -24,10 +24,6 @@ enum { #define SYSVAR_FILE "/cfg.json" #endif -#if not defined(SYSVAR_DOCUMENT_SIZE) - #define SYSVAR_DOCUMENT_SIZE (4096) -#endif - /** * @brief Get value * @@ -43,7 +39,7 @@ T svGetV(const String & name, int * result = nullptr) { T rv{}; int res; - DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); + JsonDocument doc; File f; f = USEDFS.open(F(SYSVAR_FILE), "r"); @@ -83,7 +79,7 @@ T svGetV(const String & name, int * result, const String & fname) { T rv{}; int res; - DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); + JsonDocument doc; File f; f = USEDFS.open(fname, "r"); @@ -121,7 +117,7 @@ template int svSetV(const String & name, T value) { int res; - DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); + JsonDocument doc; File f; f = USEDFS.open(F(SYSVAR_FILE), "r"); @@ -159,7 +155,7 @@ template int svSetV(const String & name, T value, const String & fname) { int res = SV_UNSPECIFIED_ERROR; - DynamicJsonDocument doc(SYSVAR_DOCUMENT_SIZE); + JsonDocument doc; File f; f = USEDFS.open(fname, "r");