Better ADALights pin 3 handling.
This commit is contained in:
parent
f8df7ebb7c
commit
0a7df86f3f
@ -305,9 +305,6 @@ void WLED::setup()
|
||||
#else
|
||||
DEBUG_PRINT("esp8266 ");
|
||||
DEBUG_PRINTLN(ESP.getCoreVersion());
|
||||
#ifdef WLED_DEBUG
|
||||
pinManager.allocatePin(1,true); // GPIO1 reserved for debug output
|
||||
#endif
|
||||
#endif
|
||||
DEBUG_PRINT("heap ");
|
||||
DEBUG_PRINTLN(ESP.getFreeHeap());
|
||||
@ -316,12 +313,16 @@ void WLED::setup()
|
||||
//DEBUG_PRINT(F("LEDs inited. heap usage ~"));
|
||||
//DEBUG_PRINTLN(heapPreAlloc - ESP.getFreeHeap());
|
||||
|
||||
#ifdef WLED_DEBUG
|
||||
pinManager.allocatePin(1,true); // GPIO1 reserved for debug output
|
||||
#endif
|
||||
#ifdef WLED_USE_DMX //reserve GPIO2 as hardcoded DMX pin
|
||||
pinManager.allocatePin(2);
|
||||
#endif
|
||||
#ifdef WLED_ENABLE_ADALIGHT // reserve GPIO3 (RX) pin for ADALight
|
||||
pinManager.allocatePin(3);
|
||||
pinManager.allocatePin(2,false);
|
||||
#endif
|
||||
//#ifdef WLED_ENABLE_ADALIGHT // reserve GPIO3 (RX) pin for ADALight
|
||||
// pinManager.allocatePin(3,false);
|
||||
//#endif
|
||||
|
||||
bool fsinit = false;
|
||||
DEBUGFS_PRINTLN(F("Mount FS"));
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
@ -365,7 +366,14 @@ void WLED::setup()
|
||||
WiFi.onEvent(WiFiEvent);
|
||||
#endif
|
||||
|
||||
Serial.println(F("Ada"));
|
||||
#ifdef WLED_ENABLE_ADALIGHT // reserve GPIO3 (RX) pin for ADALight
|
||||
if (!pinManager.isPinAllocated(3)) {
|
||||
Serial.println(F("Ada"));
|
||||
pinManager.allocatePin(3,false);
|
||||
} else {
|
||||
DEBUG_PRINTLN(F("ADALight disabled due to GPIO3 being used."));
|
||||
}
|
||||
#endif
|
||||
|
||||
// generate module IDs
|
||||
escapedMac = WiFi.macAddress();
|
||||
|
@ -286,7 +286,24 @@ void getSettingsJS(byte subPage, char* dest)
|
||||
oappend(SET_F(",2")); // DMX hardcoded pin
|
||||
#endif
|
||||
#ifdef WLED_ENABLE_ADALIGHT
|
||||
oappend(SET_F(",3")); // ADALight (RX) pin
|
||||
// inform settings page that pin 3 is used by ADALights if not aleready used by strip (previous setup)
|
||||
// NOTE: this will prohibit pin 3 use on new installs
|
||||
{
|
||||
bool pin3used = false;
|
||||
for (uint8_t s=0; s < busses.getNumBusses(); s++) {
|
||||
Bus* bus = busses.getBus(s);
|
||||
uint8_t pins[5];
|
||||
uint8_t nPins = bus->getPins(pins);
|
||||
for (uint8_t i = 0; i < nPins; i++) {
|
||||
if (pins[i] == 3) {
|
||||
pin3used = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pin3used) break;
|
||||
}
|
||||
if (!pin3used && pinManager.isPinAllocated(3)) oappend(SET_F(",3")); // ADALight (RX) pin
|
||||
}
|
||||
#endif
|
||||
#ifdef WLED_DEBUG
|
||||
oappend(SET_F(",1")); // debug output (TX) pin
|
||||
|
Loading…
Reference in New Issue
Block a user