mirror of https://github.com/arendst/Tasmota.git
scripter better button event
This commit is contained in:
parent
5903a2b9c5
commit
f6ed6edd75
|
@ -1073,6 +1073,7 @@ chknext:
|
||||||
uint32_t index=fvar;
|
uint32_t index=fvar;
|
||||||
if (index<1 || index>MAX_KEYS) index=1;
|
if (index<1 || index>MAX_KEYS) index=1;
|
||||||
fvar=script_button[index-1];
|
fvar=script_button[index-1];
|
||||||
|
script_button[index-1]|=0x80;
|
||||||
len++;
|
len++;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -4794,7 +4795,7 @@ bool Xdrv10(uint8_t function)
|
||||||
#ifdef USE_BUTTON_EVENT
|
#ifdef USE_BUTTON_EVENT
|
||||||
case FUNC_BUTTON_PRESSED:
|
case FUNC_BUTTON_PRESSED:
|
||||||
if (bitRead(Settings.rule_enabled, 0)) {
|
if (bitRead(Settings.rule_enabled, 0)) {
|
||||||
if (script_button[XdrvMailbox.index]!=XdrvMailbox.payload) {
|
if ((script_button[XdrvMailbox.index]&1)!=(XdrvMailbox.payload&1)) {
|
||||||
script_button[XdrvMailbox.index]=XdrvMailbox.payload;
|
script_button[XdrvMailbox.index]=XdrvMailbox.payload;
|
||||||
Run_Scripter(">b",2,0);
|
Run_Scripter(">b",2,0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue