Better ADALights pin 3 handling.
This commit is contained in:
parent
f8df7ebb7c
commit
0a7df86f3f
@ -305,9 +305,6 @@ void WLED::setup()
|
|||||||
#else
|
#else
|
||||||
DEBUG_PRINT("esp8266 ");
|
DEBUG_PRINT("esp8266 ");
|
||||||
DEBUG_PRINTLN(ESP.getCoreVersion());
|
DEBUG_PRINTLN(ESP.getCoreVersion());
|
||||||
#ifdef WLED_DEBUG
|
|
||||||
pinManager.allocatePin(1,true); // GPIO1 reserved for debug output
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
DEBUG_PRINT("heap ");
|
DEBUG_PRINT("heap ");
|
||||||
DEBUG_PRINTLN(ESP.getFreeHeap());
|
DEBUG_PRINTLN(ESP.getFreeHeap());
|
||||||
@ -316,12 +313,16 @@ void WLED::setup()
|
|||||||
//DEBUG_PRINT(F("LEDs inited. heap usage ~"));
|
//DEBUG_PRINT(F("LEDs inited. heap usage ~"));
|
||||||
//DEBUG_PRINTLN(heapPreAlloc - ESP.getFreeHeap());
|
//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
|
#ifdef WLED_USE_DMX //reserve GPIO2 as hardcoded DMX pin
|
||||||
pinManager.allocatePin(2);
|
pinManager.allocatePin(2,false);
|
||||||
#endif
|
|
||||||
#ifdef WLED_ENABLE_ADALIGHT // reserve GPIO3 (RX) pin for ADALight
|
|
||||||
pinManager.allocatePin(3);
|
|
||||||
#endif
|
#endif
|
||||||
|
//#ifdef WLED_ENABLE_ADALIGHT // reserve GPIO3 (RX) pin for ADALight
|
||||||
|
// pinManager.allocatePin(3,false);
|
||||||
|
//#endif
|
||||||
|
|
||||||
bool fsinit = false;
|
bool fsinit = false;
|
||||||
DEBUGFS_PRINTLN(F("Mount FS"));
|
DEBUGFS_PRINTLN(F("Mount FS"));
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
@ -365,7 +366,14 @@ void WLED::setup()
|
|||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
#endif
|
#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
|
// generate module IDs
|
||||||
escapedMac = WiFi.macAddress();
|
escapedMac = WiFi.macAddress();
|
||||||
|
@ -286,7 +286,24 @@ void getSettingsJS(byte subPage, char* dest)
|
|||||||
oappend(SET_F(",2")); // DMX hardcoded pin
|
oappend(SET_F(",2")); // DMX hardcoded pin
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_ADALIGHT
|
#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
|
#endif
|
||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
oappend(SET_F(",1")); // debug output (TX) pin
|
oappend(SET_F(",1")); // debug output (TX) pin
|
||||||
|
Loading…
Reference in New Issue
Block a user