From 84af178c3f232b969ebe68823522f7e561386c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 7 Oct 2018 22:25:10 +0200 Subject: [PATCH] Command to save settings when SETTINGS_AUTOSAVE is off --- code/espurna/config/general.h | 2 +- code/espurna/settings.ino | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 9854b06a..04850ea1 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -798,7 +798,7 @@ // ----------------------------------------------------------------------------- #ifndef SETTINGS_AUTOSAVE -#define SETTINGS_AUTOSAVE 1 // Autosave settings o force manual commit +#define SETTINGS_AUTOSAVE 1 // Autosave settings or force manual commit #endif #define SETTINGS_MAX_LIST_COUNT 10 // Maximum index for settings lists diff --git a/code/espurna/settings.ino b/code/espurna/settings.ino index 713ede6e..53657cab 100644 --- a/code/espurna/settings.ino +++ b/code/espurna/settings.ino @@ -308,6 +308,13 @@ void _settingsInitCommands() { DEBUG_MSG_P(PSTR("\n+OK\n")); }); + #if not SETTINGS_AUTOSAVE + settingsRegisterCommand(F("SAVE"), [](Embedis* e) { + _settings_save = true; + DEBUG_MSG_P(PSTR("\n+OK\n")); + }); + #endif + } // -----------------------------------------------------------------------------