mirror of
https://github.com/wled/WLED.git
synced 2025-04-23 22:37:18 +00:00
added interrupt detach to cfg.cpp
This commit is contained in:
parent
509675fe66
commit
0453a5fb3d
@ -235,6 +235,9 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
||||
if (!hw_btn_ins.isNull()) {
|
||||
for (uint8_t b = 0; b < WLED_MAX_BUTTONS; b++) { // deallocate existing button pins
|
||||
pinManager.deallocatePin(btnPin[b], PinOwner::Button); // does nothing if trying to deallocate a pin with PinOwner != Button
|
||||
#ifdef SOC_TOUCH_VERSION_2 // ESP32 S2 and S3 have a fucntion to check touch state, detach any previous assignments
|
||||
touchDetachInterrupt(btnPin[b]);
|
||||
#endif
|
||||
}
|
||||
uint8_t s = 0;
|
||||
for (JsonObject btn : hw_btn_ins) {
|
||||
@ -260,9 +263,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
||||
touchAttachInterrupt(btnPin[s], touchButtonISR, touchThreshold<<4); //threshold on Touch V2 is much higher (1500 is a value given by Espressif example)
|
||||
}
|
||||
#endif
|
||||
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
if (disablePullUp) {
|
||||
pinMode(btnPin[s], INPUT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user