From d3a97f106222d208011dd84f3aa5781579afd20e Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Sun, 7 Apr 2024 13:49:17 +0200 Subject: [PATCH] removed detachinterrupt from pin manager, added it to set.cpp instead --- wled00/pin_manager.cpp | 5 ----- wled00/set.cpp | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wled00/pin_manager.cpp b/wled00/pin_manager.cpp index e80583464d..044dc6c92e 100644 --- a/wled00/pin_manager.cpp +++ b/wled00/pin_manager.cpp @@ -32,11 +32,6 @@ bool PinManagerClass::deallocatePin(byte gpio, PinOwner tag) return false; } - #ifdef SOC_TOUCH_VERSION_2 // ESP32 S2 and S3 have a fucntion to check touch state, detach any previous assignments - if (digitalPinToTouchChannel(gpio) >= 0) //if touch capable pin - touchDetachInterrupt(gpio); - #endif - byte by = gpio >> 3; byte bi = gpio - 8*by; bitWrite(pinAlloc[by], bi, false); diff --git a/wled00/set.cpp b/wled00/set.cpp index 8a461fbc8b..0920588fed 100755 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -108,6 +108,10 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) for (uint8_t s=0; s=0 && pinManager.isPinAllocated(btnPin[s], PinOwner::Button)) { pinManager.deallocatePin(btnPin[s], PinOwner::Button); + #ifdef SOC_TOUCH_VERSION_2 // ESP32 S2 and S3 have a function to check touch state, detach interrupt + if (digitalPinToTouchChannel(btnPin[i]) >= 0) // if touch capable pin + touchDetachInterrupt(btnPin[i]); // if not assigned previously, this will do nothing + #endif } } @@ -270,7 +274,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) #endif } else -#endif + #endif { if (disablePullUp) { pinMode(btnPin[i], INPUT);