Ignore analogue pin -1 on ESP8266

pull/1977/head
Blaz Kristan 2021-05-28 17:45:14 +02:00
rodzic 664fad96fa
commit 7685f9b73d
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -148,7 +148,11 @@ void handleButton()
static unsigned long lastRead = 0UL;
for (uint8_t b=0; b<WLED_MAX_BUTTONS; b++) {
#ifdef ESP8266
if ((btnPin[b]<0 && buttonType[b] != BTN_TYPE_ANALOG) || buttonType[b] == BTN_TYPE_NONE) continue;
#else
if (btnPin[b]<0 || buttonType[b] == BTN_TYPE_NONE) continue;
#endif
if (buttonType[b] == BTN_TYPE_ANALOG && millis() - lastRead > 250) { // button is not a button but a potentiometer
if (b+1 == WLED_MAX_BUTTONS) lastRead = millis();