@@ -639,16 +639,16 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
639639
640640static const char s_cfg_json[] PROGMEM = " /cfg.json" ;
641641
642- void deserializeConfigFromFS () {
643- bool success = deserializeConfigSec ();
642+ bool deserializeConfigFromFS () {
643+ [[maybe_unused]] bool success = deserializeConfigSec ();
644644 #ifdef WLED_ADD_EEPROM_SUPPORT
645645 if (!success) { // if file does not exist, try reading from EEPROM
646646 deEEPSettings ();
647- return ;
647+ return true ;
648648 }
649649 #endif
650650
651- if (!requestJSONBufferLock (1 )) return ;
651+ if (!requestJSONBufferLock (1 )) return false ;
652652
653653 DEBUG_PRINTLN (F (" Reading settings from /cfg.json..." ));
654654
@@ -658,17 +658,11 @@ void deserializeConfigFromFS() {
658658 #ifdef WLED_ADD_EEPROM_SUPPORT
659659 deEEPSettings ();
660660 #endif
661-
662- // save default values to /cfg.json
663- // call readFromConfig() with an empty object so that usermods can initialize to defaults prior to saving
664- JsonObject empty = JsonObject ();
665- UsermodManager::readFromConfig (empty);
666- serializeConfig ();
667661 // init Ethernet (in case default type is set at compile time)
668662 #ifdef WLED_USE_ETHERNET
669663 WLED::instance ().initEthernet ();
670664 #endif
671- return ;
665+ return true ; // config does not exist (we will need to save it once strip is initialised)
672666 }
673667
674668 // NOTE: This routine deserializes *and* applies the configuration
@@ -677,7 +671,7 @@ void deserializeConfigFromFS() {
677671 bool needsSave = deserializeConfig (root, true );
678672 releaseJSONBufferLock ();
679673
680- if ( needsSave) serializeConfig (); // usermods required new parameters
674+ return needsSave;
681675}
682676
683677void serializeConfig () {
0 commit comments