scripter bug fix

fix bug that webfrefresh was affected by permanent variables p:var
This commit is contained in:
gemu2015 2019-09-14 07:48:55 +02:00
parent 6aec536819
commit 777956b634
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}