Dynamic bus config

- provide LED types from BusManager for settings
Credit: @netmindz for the idea.
This commit is contained in:
Blaz Kristan
2024-08-22 17:15:12 +02:00
parent 0bbd6b7c4b
commit 6f3267aee9
6 changed files with 278 additions and 253 deletions

View File

@@ -215,7 +215,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
}
//doInitBusses = busesChanged; // we will do that below to ensure all input data is processed
ColorOrderMap com = {};
for (int s = 0; s < WLED_MAX_COLOR_ORDER_MAPPINGS; s++) {
int offset = s < 10 ? 48 : 55;
char xs[4] = "XS"; xs[2] = offset+s; xs[3] = 0; //start LED
@@ -227,10 +226,9 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
length = request->arg(xc).toInt();
colorOrder = request->arg(xo).toInt() & 0x0F;
colorOrder |= (request->arg(xw).toInt() & 0x0F) << 4; // add W swap information
com.add(start, length, colorOrder);
if (!BusManager::getColorOrderMap().add(start, length, colorOrder)) break;
}
}
BusManager::updateColorOrderMap(com);
// update other pins
#ifndef WLED_DISABLE_INFRARED