Fix ESP32 LoadStoreError when using ``#define USER_TEMPLATE``

Fix ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506)
This commit is contained in:
Theo Arends 2020-12-20 16:40:49 +01:00
parent 7599dab36d
commit 09bb1ecb8e
4 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Redesign syslog and mqttlog using log buffer (#10164)
- Shelly Dimmer power on state (#10154, #10182)
- Wemo emulation for single devices (#10165, #10194)
- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506)
## [Released]

View File

@ -67,3 +67,4 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Redesign syslog and mqttlog using log buffer (#10164)
- Shelly Dimmer power on state (#10154, #10182)
- Wemo emulation for single devices (#10165, #10194)
- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506)

View File

@ -53,7 +53,7 @@
//#define MODULE SONOFF_BASIC // [Module] Select default module from tasmota_template.h
#ifdef ESP8266
#define FALLBACK_MODULE SONOFF_BASIC // [Module2] Select default module on fast reboot where USER_MODULE is user template
//#define USER_TEMPLATE "{\"NAME\":\"Generic\",\"GPIO\":[255,255,255,255,255,255,255,255,255,255,255,255,255],\"FLAG\":15,\"BASE\":18}" // [Template] Set JSON template
//#define USER_TEMPLATE "{\"NAME\":\"Generic\",\"GPIO\":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"FLAG\":0,\"BASE\":18}" // [Template] Set JSON template
#endif // ESP8266
#ifdef ESP32
#define FALLBACK_MODULE WEMOS // [Module2] Select default module on fast reboot where USER_MODULE is user template

View File

@ -1049,7 +1049,8 @@ void SettingsDefaultSet2(void)
flag4.mqtt_no_retain |= MQTT_NO_RETAIN;
#ifdef USER_TEMPLATE
JsonTemplate((char *)USER_TEMPLATE);
String user_template = USER_TEMPLATE;
JsonTemplate((char*)user_template.c_str());
#endif
Settings.flag = flag;