mirror of https://github.com/arendst/Tasmota.git
scripter math functions
This commit is contained in:
parent
33e9d867c8
commit
4ea287eb5b
|
@ -1059,6 +1059,19 @@ char *isvar(char *lp, uint8_t *vtype,struct T_INDEX *tind,float *fp,char *sp,Jso
|
|||
|
||||
chknext:
|
||||
switch (vname[0]) {
|
||||
case 'a':
|
||||
#ifdef USE_ANGLE_FUNC
|
||||
if (!strncmp(vname,"acos(",5)) {
|
||||
lp+=5;
|
||||
lp=GetNumericResult(lp,OPER_EQU,&fvar,0);
|
||||
fvar=acosf(fvar);
|
||||
lp++;
|
||||
len=0;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
if (!strncmp(vname,"boot",4)) {
|
||||
if (rules_flag.system_boot) {
|
||||
|
@ -1678,6 +1691,24 @@ chknext:
|
|||
len+=1;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_ANGLE_FUNC
|
||||
if (!strncmp(vname,"sin(",4)) {
|
||||
lp+=4;
|
||||
lp=GetNumericResult(lp,OPER_EQU,&fvar,0);
|
||||
fvar=sinf(fvar);
|
||||
lp++;
|
||||
len=0;
|
||||
goto exit;
|
||||
}
|
||||
if (!strncmp(vname,"sqrt(",5)) {
|
||||
lp+=5;
|
||||
lp=GetNumericResult(lp,OPER_EQU,&fvar,0);
|
||||
fvar=sqrtf(fvar);
|
||||
lp++;
|
||||
len=0;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 't':
|
||||
|
|
Loading…
Reference in New Issue