mirror of https://github.com/arendst/Tasmota.git
Fix GPIO16 Pull-down
This commit is contained in:
parent
9c3fb240c1
commit
54763329f8
|
@ -54,7 +54,7 @@ void ButtonInit(void)
|
|||
for (byte i = 0; i < MAX_KEYS; i++) {
|
||||
if (pin[GPIO_KEY1 +i] < 99) {
|
||||
buttons_found++;
|
||||
pinMode(pin[GPIO_KEY1 +i], (16 == pin[GPIO_KEY1 +i]) ? INPUT_PULLDOWN_16 : bitRead(key_no_pullup, i) ? INPUT : INPUT_PULLUP);
|
||||
pinMode(pin[GPIO_KEY1 +i], bitRead(key_no_pullup, i) ? INPUT : ((16 == pin[GPIO_KEY1 +i]) ? INPUT_PULLDOWN_16 : INPUT_PULLUP));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ void SwitchInit(void)
|
|||
lastwallswitch[i] = 1; // Init global to virtual switch state;
|
||||
if (pin[GPIO_SWT1 +i] < 99) {
|
||||
switches_found++;
|
||||
pinMode(pin[GPIO_SWT1 +i], (16 == pin[GPIO_SWT1 +i]) ? INPUT_PULLDOWN_16 : bitRead(switch_no_pullup, i) ? INPUT : INPUT_PULLUP);
|
||||
pinMode(pin[GPIO_SWT1 +i], bitRead(switch_no_pullup, i) ? INPUT : ((16 == pin[GPIO_SWT1 +i]) ? INPUT_PULLDOWN_16 : INPUT_PULLUP));
|
||||
lastwallswitch[i] = digitalRead(pin[GPIO_SWT1 +i]); // Set global now so doesn't change the saved power state on first switch check
|
||||
}
|
||||
switch_virtual[i] = lastwallswitch[i];
|
||||
|
|
Loading…
Reference in New Issue