Upravy pro ArduinoJson 7 (>= 7.0.3) #1

Merged
pablo2048 merged 1 commits from feature/ArduinoJson7 into master 2024-02-27 09:58:52 +01:00
Showing only changes of commit 06bbd7a874 - Show all commits

View File

@ -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 <typename T>
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 <typename T>
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");