Fix for issue 'wdt reset' #5 - reset of script on first boot

pull/16/head
Martin Ger 2017-10-08 17:02:53 +02:00
rodzic cb563d13fd
commit ed3a3b621e
6 zmienionych plików z 12 dodań i 4 usunięć

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1,2 @@
8c0436ab218b8b4165f57501775797e09e818ae0 0x00000.bin
b02f819746fe72bb7692e9c6bb2c37d175f58b24 0x10000.bin

Wyświetl plik

@ -42,3 +42,4 @@ INCLUDES += -I ./
PDIR := ../$(PDIR)
sinclude $(PDIR)Makefile

Wyświetl plik

@ -73,7 +73,7 @@
#define JSON_PARSE 1
//
// Define this if you want to have mDNS support in scripts.
// Define this if you want to have mDNS support.
//
#define MDNS 1

Wyświetl plik

@ -692,7 +692,7 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn) {
config_load_default(&config);
config_save(&config);
#ifdef SCRIPTED
// clear script
// Clear script and vars
blob_zero(0, MAX_SCRIPT_SIZE);
blob_zero(1, MAX_FLASH_SLOTS * FLASH_SLOT_LEN);
#endif
@ -1528,10 +1528,11 @@ void user_init() {
os_printf("\r\n\r\nWiFi Router/MQTT Broker V2.0 starting\r\n");
// Load config
config_load(&config);
int config_res = config_load(&config);
#ifdef SCRIPTED
script_enabled = false;
if (read_script()) {
if ((config_res == 0) && read_script()) {
if (interpreter_syntax_check() != -1) {
bool lockstat = config.locked;
config.locked = false;
@ -1543,6 +1544,10 @@ void user_init() {
} else {
os_printf("ERROR in script: %s\r\nScript disabled\r\n", tmp_buffer);
}
} else {
// Clear script and vars
blob_zero(0, MAX_SCRIPT_SIZE);
blob_zero(1, MAX_FLASH_SLOTS * FLASH_SLOT_LEN);
}
#endif