From eaa619df69a314a65bedf5a243dfd1ba3184761c Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 4 Dec 2022 02:50:57 +0100 Subject: [PATCH] pin info: conflicts include input-only record conflict if pin was requested as in/out but pin is input-only --- wled00/pin_manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wled00/pin_manager.cpp b/wled00/pin_manager.cpp index c8d8a7b4..0db06ba5 100644 --- a/wled00/pin_manager.cpp +++ b/wled00/pin_manager.cpp @@ -298,6 +298,9 @@ bool PinManagerClass::allocateMultiplePins(const managed_pin_type * mptArray, by DEBUG_PRINT(" as "); DEBUG_PRINT(mptArray[i].isOutput ? "output": "input"); // WLEDMM DEBUG_PRINTLN(F("")); #endif + if ((gpio < 50) && (gpio >= 0) && (tag != PinOwner::None)) { + ownerConflict[gpio] = tag; // WLEDMM record conflict + } shouldFail = true; } if ((tag==PinOwner::HW_I2C || tag==PinOwner::HW_SPI) && isPinAllocated(gpio, tag)) { @@ -353,6 +356,9 @@ bool PinManagerClass::allocatePin(byte gpio, bool output, PinOwner tag) #ifdef WLED_DEBUG if (gpio < 255) { // 255 (-1) is the "not defined GPIO" if (!isPinOk(gpio, output)) { + if ((gpio < 50) && (gpio >= 0) && (tag != PinOwner::None)) { + ownerConflict[gpio] = tag; // WLEDMM record conflict + } DEBUG_PRINT(F("PIN ALLOC: FAIL for owner ")); DebugPrintOwnerTag(tag); DEBUG_PRINT(F(": GPIO ")); DEBUG_PRINT(gpio);