From ec7519186affb100aa5c1ec40e12049604f382b6 Mon Sep 17 00:00:00 2001 From: PaoloTK Date: Sun, 11 Aug 2024 14:37:36 +0200 Subject: [PATCH] fix default pin assignement for unassigned buttons --- wled00/wled.cpp | 4 ++++ wled00/wled.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index a6143eee6f..88789dcade 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -429,6 +429,10 @@ void WLED::setup() DEBUG_PRINT(F("heap ")); DEBUG_PRINTLN(ESP.getFreeHeap()); + // Set all button pins without an assigned type to -1. + // This is necessary because partially initializing an array fills the remaining elements with 0, which is a valid GPIO. + for (unsigned i=0; i