Net Debug / Net Serial updates

Add PinManagerClass::manageDebugTXPin to handle allocating pins for WLED_DEBUG_HOST and WLED_DEBUG
This commit is contained in:
Ewoud
2023-03-23 14:21:42 +01:00
parent d424c738cd
commit 27c4d98ada
9 changed files with 1346 additions and 1327 deletions

View File

@@ -495,6 +495,20 @@ bool PinManagerClass::allocatePin(byte gpio, bool output, PinOwner tag)
return true;
}
void PinManagerClass::manageDebugTXPin()
{
#ifdef WLED_DEBUG_HOST
if (netDebugEnabled) deallocatePin(hardwareTX, PinOwner::DebugOut);
#ifdef WLED_DEBUG
else allocatePin(hardwareTX, true, PinOwner::DebugOut);
#endif
#else
#ifdef WLED_DEBUG
pinManager.allocatePin(hardwareTX, true, PinOwner::DebugOut); // TX (GPIO1 on ESP32) reserved for debug output
#endif
#endif
}
// if tag is set to PinOwner::None, checks for ANY owner of the pin.
// if tag is set to any other value, checks if that tag is the current owner of the pin.
bool PinManagerClass::isPinAllocated(byte gpio, PinOwner tag)