mirror of
https://github.com/wled/WLED.git
synced 2025-11-09 19:18:54 +00:00
Better ADALights pin 3 handling.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user