mirror of https://github.com/arendst/Tasmota.git
Add PRECONFIGURED_SCRIPT and START_SCRIPT_FROM_BOOT options
Change allows to define a PRECONFIGURED_SCRIPT in user_config_override.h and to start a script from boot by defining START_SCRIPT_FROM_BOOT.
This commit is contained in:
parent
b5367f7743
commit
0de562567b
|
@ -8383,8 +8383,16 @@ bool Xdrv10(uint8_t function)
|
|||
if (glob_script_mem.script_ram[0]!='>' && glob_script_mem.script_ram[1]!='D') {
|
||||
// clr all
|
||||
memset(glob_script_mem.script_ram, 0 ,glob_script_mem.script_size);
|
||||
#ifdef PRECONFIGURED_SCRIPT
|
||||
strcpy_P(glob_script_mem.script_ram, PSTR(PRECONFIGURED_SCRIPT));
|
||||
#else
|
||||
strcpy_P(glob_script_mem.script_ram, PSTR(">D\nscript error must start with >D"));
|
||||
#endif
|
||||
#ifdef START_SCRIPT_FROM_BOOT
|
||||
bitWrite(Settings->rule_enabled, 0, 1);
|
||||
#else
|
||||
bitWrite(Settings->rule_enabled, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
// assure permanent memory is 4 byte aligned
|
||||
|
|
Loading…
Reference in New Issue