mirror of https://github.com/arendst/Tasmota.git
Merge pull request #4884 from netpok/bugfix-pulldown
Fix GPIO16 Pull-down
This commit is contained in:
commit
0b4bed6099
|
@ -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