mirror of https://github.com/arendst/Tasmota.git
scripter pram update
This commit is contained in:
parent
75a62cd3b9
commit
72f2e944d5
|
@ -421,7 +421,7 @@ struct SYSCFG {
|
||||||
unsigned long weight_calibration; // 7C4
|
unsigned long weight_calibration; // 7C4
|
||||||
unsigned long energy_frequency_calibration; // 7C8 also used by HX711 to save last weight
|
unsigned long energy_frequency_calibration; // 7C8 also used by HX711 to save last weight
|
||||||
uint16_t web_refresh; // 7CC
|
uint16_t web_refresh; // 7CC
|
||||||
char script_pram[5][10]; // 7CE
|
uint8_t script_pram[50]; // 7CE
|
||||||
|
|
||||||
char rules[MAX_RULE_SETS][MAX_RULE_SIZE]; // 800 uses 512 bytes in v5.12.0m, 3 x 512 bytes in v5.14.0b
|
char rules[MAX_RULE_SETS][MAX_RULE_SIZE]; // 800 uses 512 bytes in v5.12.0m, 3 x 512 bytes in v5.14.0b
|
||||||
|
|
||||||
|
|
|
@ -1378,11 +1378,6 @@ void SettingsDelta(void)
|
||||||
SettingsUpdateText(SET_NTPSERVER1, Settings.ex_ntp_server[0]);
|
SettingsUpdateText(SET_NTPSERVER1, Settings.ex_ntp_server[0]);
|
||||||
SettingsUpdateText(SET_NTPSERVER2, Settings.ex_ntp_server[1]);
|
SettingsUpdateText(SET_NTPSERVER2, Settings.ex_ntp_server[1]);
|
||||||
SettingsUpdateText(SET_NTPSERVER3, Settings.ex_ntp_server[2]);
|
SettingsUpdateText(SET_NTPSERVER3, Settings.ex_ntp_server[2]);
|
||||||
SettingsUpdateText(SET_MEM1, Settings.script_pram[0]);
|
|
||||||
SettingsUpdateText(SET_MEM2, Settings.script_pram[1]);
|
|
||||||
SettingsUpdateText(SET_MEM3, Settings.script_pram[2]);
|
|
||||||
SettingsUpdateText(SET_MEM4, Settings.script_pram[3]);
|
|
||||||
SettingsUpdateText(SET_MEM5, Settings.script_pram[4]);
|
|
||||||
SettingsUpdateText(SET_FRIENDLYNAME1, Settings.ex_friendlyname[0]);
|
SettingsUpdateText(SET_FRIENDLYNAME1, Settings.ex_friendlyname[0]);
|
||||||
SettingsUpdateText(SET_FRIENDLYNAME2, Settings.ex_friendlyname[1]);
|
SettingsUpdateText(SET_FRIENDLYNAME2, Settings.ex_friendlyname[1]);
|
||||||
SettingsUpdateText(SET_FRIENDLYNAME3, Settings.ex_friendlyname[2]);
|
SettingsUpdateText(SET_FRIENDLYNAME3, Settings.ex_friendlyname[2]);
|
||||||
|
|
|
@ -56,7 +56,8 @@ keywords if then else endif, or, and are better readable for beginners (others m
|
||||||
#define SCRIPT_MAXSSIZE 48
|
#define SCRIPT_MAXSSIZE 48
|
||||||
#define SCRIPT_EOL '\n'
|
#define SCRIPT_EOL '\n'
|
||||||
#define SCRIPT_FLOAT_PRECISION 2
|
#define SCRIPT_FLOAT_PRECISION 2
|
||||||
#define SCRIPT_MAXPERM (5*10)-4/sizeof(float)
|
#define PMEM_SIZE sizeof(Settings.script_pram)
|
||||||
|
#define SCRIPT_MAXPERM (PMEM_SIZE)-4/sizeof(float)
|
||||||
#define MAX_SCRIPT_SIZE MAX_RULE_SIZE*MAX_RULE_SETS
|
#define MAX_SCRIPT_SIZE MAX_RULE_SIZE*MAX_RULE_SETS
|
||||||
|
|
||||||
// offsets epoch readings by 1.1.2019 00:00:00 to fit into float with second resolution
|
// offsets epoch readings by 1.1.2019 00:00:00 to fit into float with second resolution
|
||||||
|
@ -1575,7 +1576,7 @@ chknext:
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
if (!strncmp(vname,"ram",3)) {
|
if (!strncmp(vname,"ram",3)) {
|
||||||
fvar=glob_script_mem.script_mem_size+(glob_script_mem.script_size)+(5*10);
|
fvar=glob_script_mem.script_mem_size+(glob_script_mem.script_size)+(PMEM_SIZE);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3004,7 +3005,7 @@ void Scripter_save_pvars(void) {
|
||||||
if (vtp[count].bits.is_permanent && !vtp[count].bits.is_string) {
|
if (vtp[count].bits.is_permanent && !vtp[count].bits.is_string) {
|
||||||
uint8_t index=vtp[count].index;
|
uint8_t index=vtp[count].index;
|
||||||
mlen+=sizeof(float);
|
mlen+=sizeof(float);
|
||||||
if (mlen>5*10) {
|
if (mlen>PMEM_SIZE) {
|
||||||
vtp[count].bits.is_permanent=0;
|
vtp[count].bits.is_permanent=0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3018,7 +3019,7 @@ void Scripter_save_pvars(void) {
|
||||||
char *sp=glob_script_mem.glob_snp+(index*glob_script_mem.max_ssize);
|
char *sp=glob_script_mem.glob_snp+(index*glob_script_mem.max_ssize);
|
||||||
uint8_t slen=strlen(sp);
|
uint8_t slen=strlen(sp);
|
||||||
mlen+=slen+1;
|
mlen+=slen+1;
|
||||||
if (mlen>5*10) {
|
if (mlen>PMEM_SIZE) {
|
||||||
vtp[count].bits.is_permanent=0;
|
vtp[count].bits.is_permanent=0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4751,7 +4752,7 @@ bool Xdrv10(uint8_t function)
|
||||||
glob_script_mem.script_size=MAX_SCRIPT_SIZE;
|
glob_script_mem.script_size=MAX_SCRIPT_SIZE;
|
||||||
glob_script_mem.flags=0;
|
glob_script_mem.flags=0;
|
||||||
glob_script_mem.script_pram=(uint8_t*)Settings.script_pram[0];
|
glob_script_mem.script_pram=(uint8_t*)Settings.script_pram[0];
|
||||||
glob_script_mem.script_pram_size=5*10;
|
glob_script_mem.script_pram_size=PMEM_SIZE;
|
||||||
|
|
||||||
#ifdef USE_BUTTON_EVENT
|
#ifdef USE_BUTTON_EVENT
|
||||||
for (uint32_t cnt=0;cnt<MAX_KEYS;cnt++) {
|
for (uint32_t cnt=0;cnt<MAX_KEYS;cnt++) {
|
||||||
|
|
Loading…
Reference in New Issue