From 12fb67cc63df03ddafedfd7759eaf0e51ac92abd Mon Sep 17 00:00:00 2001 From: Ing-Dom Date: Wed, 17 Jul 2024 22:22:58 +0200 Subject: [PATCH] fix: only set pinMode of Prog button pin when pin is >= 0 and isr function is defined otherwise it is useless anyway and causes warnings. --- src/knx_facade.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/knx_facade.h b/src/knx_facade.h index 75d8fdb..3f1c60b 100644 --- a/src/knx_facade.h +++ b/src/knx_facade.h @@ -286,10 +286,10 @@ template class KnxFacade : private SaveRestore pinMode(ledPin(), OUTPUT); progLedOff(); - pinMode(buttonPin(), INPUT_PULLUP); - + if (_progButtonISRFuncPtr && _buttonPin >= 0) { + pinMode(buttonPin(), INPUT_PULLUP); // Workaround for https://github.com/arduino/ArduinoCore-samd/issues/587 #if (ARDUINO_API_VERSION >= 10200) attachInterrupt(_buttonPin, _progButtonISRFuncPtr, (PinStatus)CHANGE);