From 777956b634101fe64fed74bfff97ccd9107edb58 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 14 Sep 2019 07:48:55 +0200 Subject: [PATCH] scripter bug fix fix bug that webfrefresh was affected by permanent variables p:var --- sonoff/xdrv_10_scripter.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonoff/xdrv_10_scripter.ino b/sonoff/xdrv_10_scripter.ino index 3a87aec44..a8dc6adf4 100644 --- a/sonoff/xdrv_10_scripter.ino +++ b/sonoff/xdrv_10_scripter.ino @@ -2045,6 +2045,8 @@ void Replace_Cmd_Vars(char *srcbuf,char *dstbuf,uint16_t dstsize) { if (isdigit(*cp)) { dprec=*cp&0xf; cp++; + } else { + dprec=glob_script_mem.script_dprec; } cp=isvar(cp,&vtype,&ind,&fvar,string,0); if (vtype!=VAR_NV) { @@ -3343,7 +3345,6 @@ bool ScriptCommand(void) { if (XdrvMailbox.data[count]==';') XdrvMailbox.data[count]='\n'; } execute_script(XdrvMailbox.data); - Scripter_save_pvars(); } } return serviced; @@ -3735,6 +3736,7 @@ bool Xdrv10(uint8_t function) // assure permanent memory is 4 byte aligned { uint32_t ptr=(uint32_t)glob_script_mem.script_pram; ptr&=0xfffffffc; + ptr+=4; glob_script_mem.script_pram=(uint8_t*)ptr; glob_script_mem.script_pram_size-=4; }