very medium updates (GPIO info, part1)

Improvements for debugging GPIO conflicts. HTML UI integration still pending.

* pinManager can be asked for pin owner (String) and pin special purpose (string).
* wled.cpp: show GPIO allocation when compiling with WLED_DEBUG
* pinmanager: show Pin Owner as name when possible.

The results looks like this

GPIO    | Assigned to           | Info
--------|-----------------------|------------
i/o   0   Button
i/o   1   debug                   Serial TX
i/o   2   DMX out
i/o   3   ./.                     Serial RX
i/o   5   ./.                     SPI SS
i/o  15   AudioReactive (UM)
i/o  16   LEDs (digital)
i/o  17   Relay
i/o  18   ./.                     SPI CLK
i/o  19   IR Receiver             SPI MISO
i/o  21   I2C                     I2C SDA
i/o  22   I2C                     I2C SCL
i/o  23   ./.                     SPI MOSI
i/o  32   AudioReactive (UM)
This commit is contained in:
Frank
2022-12-02 00:11:28 +01:00
parent fc4170292a
commit 0dfc884c64
3 changed files with 128 additions and 1 deletions

View File

@@ -470,6 +470,27 @@ void WLED::setup()
DEBUG_PRINTF("Arduino Event core=%d\n", int(ARDUINO_EVENT_RUNNING_CORE));
#endif
#endif
// WLEDMM : dump GPIO infos (experimental, UI integration pending)
#ifdef WLED_DEBUG
Serial.println(F("WLED initialization completed."));
Serial.println(F("\nGPIO\t| Assigned to\t\t| Info"));
Serial.println(F("--------|-----------------------|------------"));
for(int pinNr = 0; pinNr < 50; pinNr++) { // 49 = highest PIN on ESP32-S3
if(pinManager.isPinOk(pinNr, false)) {
if ((!pinManager.isPinAllocated(pinNr)) && (pinManager.getPinSpecialText(pinNr).length() == 0)) continue; // comment out to also show unused GPIO pins
bool is_inOut = pinManager.isPinOk(pinNr, true);
Serial.printf("%s %2d\t %-18s\t %s\n",
(is_inOut?"i/o":"in "),
pinNr,
pinManager.getPinOwnerText(pinNr).c_str(),
pinManager.getPinSpecialText(pinNr).c_str()
);
}
}
Serial.println();
#endif
// WLEDMM end
}
void WLED::beginStrip()