mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Fix support for non-sequential buttons and switches
Fix support for non-sequential buttons and switches (#17967)
This commit is contained in:
parent
fbbf8ff781
commit
ca3045f68f
@ -134,10 +134,7 @@ void ButtonProbe(void) {
|
||||
|
||||
uint32_t not_activated;
|
||||
for (uint32_t i = 0; i < MAX_KEYS_SET; i++) {
|
||||
if (!bitRead(Button.used, i)) {
|
||||
Button.probe_mutex = false;
|
||||
return;
|
||||
}
|
||||
if (!bitRead(Button.used, i)) { continue; }
|
||||
|
||||
if (PinUsed(GPIO_KEY1, i)) {
|
||||
#if defined(SOC_TOUCH_VERSION_1) || defined(SOC_TOUCH_VERSION_2)
|
||||
@ -334,7 +331,7 @@ void ButtonHandler(void) {
|
||||
char scmnd[20];
|
||||
|
||||
for (uint32_t button_index = 0; button_index < MAX_KEYS_SET; button_index++) {
|
||||
if (!bitRead(Button.used, button_index)) { return; }
|
||||
if (!bitRead(Button.used, button_index)) { continue; }
|
||||
|
||||
uint8_t button = Button.debounced_state[button_index];
|
||||
|
||||
|
@ -142,10 +142,7 @@ void SwitchProbe(void) {
|
||||
|
||||
uint32_t not_activated;
|
||||
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
|
||||
if (!bitRead(Switch.used, i)) {
|
||||
Switch.probe_mutex = false;
|
||||
return;
|
||||
}
|
||||
if (!bitRead(Switch.used, i)) { continue; }
|
||||
|
||||
if (PinUsed(GPIO_SWT1, i)) {
|
||||
not_activated = digitalRead(Pin(GPIO_SWT1, i));
|
||||
@ -288,7 +285,7 @@ void SwitchHandler(void) {
|
||||
uint32_t loops_per_second = 1000 / Settings->switch_debounce;
|
||||
|
||||
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
|
||||
if (!bitRead(Switch.used, i)) { return; }
|
||||
if (!bitRead(Switch.used, i)) { continue; }
|
||||
|
||||
uint32_t button = Switch.debounced_state[i];
|
||||
uint32_t switchflag = POWER_TOGGLE +1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user