diff --git a/docs/source/Tools/Tools.rst b/docs/source/Tools/Tools.rst index 51fc54a6e..08f2eea3f 100644 --- a/docs/source/Tools/Tools.rst +++ b/docs/source/Tools/Tools.rst @@ -867,7 +867,8 @@ The old settings are still active in memory and if something will be saved, only This would corrupt the settings file. -With only ``USE_SETTINGS_ARCHIVE`` defined during build, the URL and credentials cannot be stored. +With only ``FEATURE_SETTINGS_ARCHIVE`` defined during build, the URL and credentials cannot be stored. +(2022/07/24: Renamed USE_SETTINGS_ARCHIVE to FEATURE_SETTINGS_ARCHIVE) For this the build must be made with ``FEATURE_CUSTOM_PROVISIONING`` defined. N.B. ``FEATURE_CUSTOM_PROVISIONING`` is added on 2022/05/13. (2022/07/24: Renamed from USE_CUSTOM_PROVISIONING to FEATURE_CUSTOM_PROVISIONING) @@ -913,7 +914,7 @@ When the build is made with ``FEATURE_CUSTOM_PROVISIONING`` defined, this Settin All Settings on the Settings Archive page can be stored in a file named ``provisioning.dat``. This file also can store the factory default settings like the device model to ease deployment of a large number of nodes. -N.B. The ``USE_SETTINGS_ARCHIVE`` define is needed to allow to edit the ``provisioning.dat`` file, but it is not needed to use the provisioning feature. +N.B. The ``FEATURE_SETTINGS_ARCHIVE`` define is needed to allow to edit the ``provisioning.dat`` file, but it is not needed to use the provisioning feature. .. image:: images/SettingsArchive_provisioning.png diff --git a/memanalyzer.py b/memanalyzer.py index a2a4566b7..5d158c45e 100755 --- a/memanalyzer.py +++ b/memanalyzer.py @@ -122,7 +122,7 @@ try: plugins.append(buildflag) plugins.append('MQTT_ONLY') - plugins.append('USE_SETTINGS_ARCHIVE') + plugins.append('FEATURE_SETTINGS_ARCHIVE=1') plugins.append('WEBSERVER_RULES_DEBUG=1') plugins.append('WEBSERVER_TIMINGSTATS') plugins.append('WEBSERVER_NEW_UI') diff --git a/src/Custom-sample.h b/src/Custom-sample.h index 2820622d6..3df06c7bd 100644 --- a/src/Custom-sample.h +++ b/src/Custom-sample.h @@ -181,7 +181,7 @@ // Allow for remote provisioning of a node. // This is only allowed for custom builds. -// To setup the configuration of the provisioning file, one must also define USE_SETTINGS_ARCHIVE +// To setup the configuration of the provisioning file, one must also define FEATURE_SETTINGS_ARCHIVE // Default setting is to not allow to configure a node remotely, unless explicitly enabled. // #define FEATURE_CUSTOM_PROVISIONING 1 @@ -200,7 +200,7 @@ -// #define USE_SETTINGS_ARCHIVE +// #define FEATURE_SETTINGS_ARCHIVE 1 // #define FEATURE_I2CMULTIPLEXER // #define USE_TRIGONOMETRIC_FUNCTIONS_RULES // #define PLUGIN_USES_ADAFRUITGFX // Used by Display plugins using Adafruit GFX library diff --git a/src/src/CustomBuild/define_plugin_sets.h b/src/src/CustomBuild/define_plugin_sets.h index a0496da7e..28ca3d2e4 100644 --- a/src/src/CustomBuild/define_plugin_sets.h +++ b/src/src/CustomBuild/define_plugin_sets.h @@ -155,14 +155,15 @@ To create/register a plugin, you have to : * Available options ********************************************************** \******************************************************************************/ #if defined(CORE_POST_2_5_0) && !defined(MEMORY_ANALYSIS) && !defined(USE_CUSTOM_H) - #ifndef USE_SETTINGS_ARCHIVE + #ifndef FEATURE_SETTINGS_ARCHIVE // FIXME TD-er: Disabled for now, to reduce binary size -// #define USE_SETTINGS_ARCHIVE - #endif // USE_SETTINGS_ARCHIVE +// #define FEATURE_SETTINGS_ARCHIVE 1 + #endif // ifndef FEATURE_SETTINGS_ARCHIVE #endif -#if defined(USE_SETTINGS_ARCHIVE) && defined(FORCE_PRE_2_5_0) - #undef USE_SETTINGS_ARCHIVE +#if FEATURE_SETTINGS_ARCHIVE && defined(FORCE_PRE_2_5_0) + #undef FEATURE_SETTINGS_ARCHIVE + #define FEATURE_SETTINGS_ARCHIVE 0 #endif @@ -357,9 +358,10 @@ To create/register a plugin, you have to : #define PLUGIN_SET_NONE - #ifdef USE_SETTINGS_ARCHIVE - #undef USE_SETTINGS_ARCHIVE - #endif // USE_SETTINGS_ARCHIVE + #if FEATURE_SETTINGS_ARCHIVE + #undef FEATURE_SETTINGS_ARCHIVE + #define FEATURE_SETTINGS_ARCHIVE 0 + #endif // if FEATURE_SETTINGS_ARCHIVE #ifdef USES_TIMING_STATS #undef USES_TIMING_STATS @@ -1523,8 +1525,8 @@ To create/register a plugin, you have to : #ifndef USE_RTTTL #define USE_RTTTL #endif - #ifndef USE_SETTINGS_ARCHIVE - #define USE_SETTINGS_ARCHIVE + #ifndef FEATURE_SETTINGS_ARCHIVE + #define FEATURE_SETTINGS_ARCHIVE 1 #endif #ifndef FEATURE_SD #define FEATURE_SD 1 @@ -1822,8 +1824,9 @@ To create/register a plugin, you have to : #ifdef FEATURE_I2CMULTIPLEXER #undef FEATURE_I2CMULTIPLEXER #endif - #ifdef USE_SETTINGS_ARCHIVE - #undef USE_SETTINGS_ARCHIVE + #if FEATURE_SETTINGS_ARCHIVE + #undef FEATURE_SETTINGS_ARCHIVE + #define FEATURE_SETTINGS_ARCHIVE 0 #endif #ifdef USE_SERVO @@ -1975,7 +1978,7 @@ To create/register a plugin, you have to : #endif #endif -#if defined(USE_SETTINGS_ARCHIVE) || FEATURE_CUSTOM_PROVISIONING +#if FEATURE_SETTINGS_ARCHIVE || FEATURE_CUSTOM_PROVISIONING #ifndef FEATURE_DOWNLOAD #define FEATURE_DOWNLOAD 1 #endif diff --git a/src/src/WebServer/SettingsArchive.cpp b/src/src/WebServer/SettingsArchive.cpp index 50cac698c..2ccf2b7d6 100644 --- a/src/src/WebServer/SettingsArchive.cpp +++ b/src/src/WebServer/SettingsArchive.cpp @@ -1,6 +1,6 @@ #include "../WebServer/SettingsArchive.h" -#ifdef USE_SETTINGS_ARCHIVE +#if FEATURE_SETTINGS_ARCHIVE #include "../WebServer/WebServer.h" #include "../WebServer/HTML_wrappers.h" @@ -241,4 +241,4 @@ bool tryDownloadFileType(const String& url, const String& user, const String& pa return false; } -#endif // ifdef USE_SETTINGS_ARCHIVE +#endif // if FEATURE_SETTINGS_ARCHIVE diff --git a/src/src/WebServer/SettingsArchive.h b/src/src/WebServer/SettingsArchive.h index 8264415ee..b0a6a94ae 100644 --- a/src/src/WebServer/SettingsArchive.h +++ b/src/src/WebServer/SettingsArchive.h @@ -3,7 +3,7 @@ #include "../WebServer/common.h" -#ifdef USE_SETTINGS_ARCHIVE +#if FEATURE_SETTINGS_ARCHIVE #include "../DataTypes/ESPEasyFileType.h" @@ -22,6 +22,6 @@ void storeDownloadFiletypeCheckbox(FileType::Enum filetype, unsigned int filenr bool tryDownloadFileType(const String& url, const String& user, const String& pass, FileType::Enum filetype, unsigned int filenr = 0); -#endif // ifdef USE_SETTINGS_ARCHIVE +#endif // if FEATURE_SETTINGS_ARCHIVE #endif \ No newline at end of file diff --git a/src/src/WebServer/ToolsPage.cpp b/src/src/WebServer/ToolsPage.cpp index 08508545c..13f85faba 100644 --- a/src/src/WebServer/ToolsPage.cpp +++ b/src/src/WebServer/ToolsPage.cpp @@ -166,9 +166,9 @@ void handle_tools() { addWideButtonPlusDescription(F("filelist"), F("File browser"), F("Show files on internal flash file system")); addWideButtonPlusDescription(F("/factoryreset"), F("Factory Reset"), F("Select pre-defined configuration or full erase of settings")); - # ifdef USE_SETTINGS_ARCHIVE + # if FEATURE_SETTINGS_ARCHIVE addWideButtonPlusDescription(F("/settingsarchive"), F("Settings Archive"), F("Download settings from some archive")); - # endif // ifdef USE_SETTINGS_ARCHIVE + # endif // if FEATURE_SETTINGS_ARCHIVE # if FEATURE_SD addWideButtonPlusDescription(F("SDfilelist"), F("SD Card"), F("Show files on SD-Card")); # endif // if FEATURE_SD diff --git a/src/src/WebServer/WebServer.cpp b/src/src/WebServer/WebServer.cpp index 0f70a806e..653227c30 100644 --- a/src/src/WebServer/WebServer.cpp +++ b/src/src/WebServer/WebServer.cpp @@ -228,9 +228,9 @@ void WebServerInit() #ifdef WEBSERVER_FACTORY_RESET web_server.on(F("/factoryreset"), handle_factoryreset); #endif // ifdef WEBSERVER_FACTORY_RESET - #ifdef USE_SETTINGS_ARCHIVE + #if FEATURE_SETTINGS_ARCHIVE web_server.on(F("/settingsarchive"), handle_settingsarchive); - #endif // ifdef USE_SETTINGS_ARCHIVE + #endif // if FEATURE_SETTINGS_ARCHIVE web_server.on(F("/favicon.ico"), handle_favicon); #ifdef WEBSERVER_FILELIST web_server.on(F("/filelist"), handle_filelist); diff --git a/tools/pio/pre_custom_esp32.py b/tools/pio/pre_custom_esp32.py index 032277aa7..5e25d5adf 100644 --- a/tools/pio/pre_custom_esp32.py +++ b/tools/pio/pre_custom_esp32.py @@ -65,7 +65,7 @@ else: "-DUSES_PLUGIN_STATS", "-DUSES_CHART_JS", - "-DUSE_SETTINGS_ARCHIVE", + "-DFEATURE_SETTINGS_ARCHIVE=1", "-DFEATURE_ESPEASY_P2P=1", "-DFEATURE_CUSTOM_PROVISIONING=1" ] diff --git a/tools/pio/pre_custom_esp82xx.py b/tools/pio/pre_custom_esp82xx.py index 34053dcf4..de72f34f3 100644 --- a/tools/pio/pre_custom_esp82xx.py +++ b/tools/pio/pre_custom_esp82xx.py @@ -65,7 +65,7 @@ else: "-DFEATURE_ESPEASY_P2P=1", - "-DUSE_SETTINGS_ARCHIVE" + "-DFEATURE_SETTINGS_ARCHIVE=1" ] my_flags = env.ParseFlags(env['BUILD_FLAGS'])