Merge pull request #13153 from Arnold-n/development+autorunscript

Add PRECONFIGURED_SCRIPT and START_SCRIPT_FROM_BOOT options
This commit is contained in:
Theo Arends 2021-09-20 11:27:05 +02:00 committed by GitHub
commit 290d38669e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

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