From d21496240a4416866fc92e5abf94c76d7bb2b680 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 4 Jul 2023 02:05:19 +0200 Subject: [PATCH] fix: Don't override configured SD Logs value when opening edit screen (#3755) changes: - set default value only if SF is created --- radio/src/gui/colorlcd/special_functions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/src/gui/colorlcd/special_functions.cpp b/radio/src/gui/colorlcd/special_functions.cpp index 290ddb92c76..85c31b6c863 100644 --- a/radio/src/gui/colorlcd/special_functions.cpp +++ b/radio/src/gui/colorlcd/special_functions.cpp @@ -230,7 +230,8 @@ class SpecialFunctionEditPage : public Page break; case FUNC_LOGS: { - CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // set default value + if(CFN_PARAM(cfn) == 0) // use stored value if SF exists + CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // otherwise initialize with default value auto edit = addNumberEdit(line, STR_INTERVAL, cfn, SD_LOGS_PERIOD_MIN, SD_LOGS_PERIOD_MAX); edit->setDefault(SD_LOGS_PERIOD_DEFAULT); // set default period for DEF button