Merge branch 'development' of https://github.com/arendst/Tasmota into development

This commit is contained in:
Theo Arends 2020-05-07 16:54:09 +02:00
commit 247bd0b44e
2 changed files with 61 additions and 4 deletions

View File

@ -17,10 +17,10 @@ extra_configs = platformio_tasmota_env.ini
platformio_override.ini
; *** Build/upload environment
default_envs =
default_envs =
; *** Uncomment by deleting ";" in the line(s) below to select version(s)
; tasmota
; tasmota-ircustom
; tasmota-ircustom
; tasmota-minimal
; tasmota-lite
; tasmota-knx
@ -66,8 +66,8 @@ platform_packages = ${core_active.platform_packages}
build_flags = ${core_active.build_flags}
; *********************************************************************
; *** Use custom settings from file user_config_override.h
-DUSE_CONFIG_OVERRIDE
; *** Use custom settings from file user_config_override.h
; -DUSE_CONFIG_OVERRIDE
; *********************************************************************
; *** Fix espressif8266@1.7.0 induced undesired all warnings

View File

@ -1186,6 +1186,22 @@ chknext:
fvar=xPortGetCoreID();
goto exit;
}
#ifdef USE_SCRIPT_TASK
if (!strncmp(vname,"ct(",3)) {
lp+=3;
lp=GetNumericResult(lp,OPER_EQU,&fvar,0);
while (*lp==' ') lp++;
float fvar1;
lp=GetNumericResult(lp,OPER_EQU,&fvar1,0);
while (*lp==' ') lp++;
float fvar2;
lp=GetNumericResult(lp,OPER_EQU,&fvar2,0);
lp++;
fvar=scripter_create_task(fvar,fvar1,fvar2);
len=0;
goto exit;
}
#endif
#endif
break;
case 'd':
@ -5099,6 +5115,47 @@ bool RulesProcessEvent(char *json_event) {
if (bitRead(Settings.rule_enabled, 0)) Run_Scripter(">E",2,json_event);
}
#ifdef ESP32
#ifdef USE_SCRIPT_TASK
uint16_t task_timer1;
uint16_t task_timer2;
void script_task1(void *arg) {
while (1) {
delay(task_timer1);
Run_Scripter(">t1",3,0);
}
}
void script_task2(void *arg) {
while (1) {
delay(task_timer2);
Run_Scripter(">t2",3,0);
}
}
#ifndef STASK_STACK
#define STASK_STACK 4096
#endif
#ifndef STASK_PRIO
#define STASK_PRIO 5
#endif
uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core) {
//return 0;
BaseType_t res=0;
if (core>1) {core = 1;}
if (num == 1) {
res = xTaskCreatePinnedToCore(script_task1, "T 1", STASK_STACK, NULL, STASK_PRIO, NULL, core);
task_timer1=time;
} else {
res = xTaskCreatePinnedToCore(script_task2, "T 2", STASK_STACK, NULL, STASK_PRIO, NULL, core);
task_timer2=time;
}
return res;
}
#endif // USE_SCRIPT_TASK
#endif // ESP32
/*********************************************************************************************\
* Interface
\*********************************************************************************************/