Skip 1st fix, save LED count, removed reverse.

This commit is contained in:
Blaz Kristan 2021-02-24 21:33:44 +01:00
parent 77dee439e6
commit d60506a75d
4 changed files with 6 additions and 8 deletions

View File

@ -140,13 +140,13 @@ class BusDigital : public Bus {
void setPixelColor(uint16_t pix, uint32_t c) { void setPixelColor(uint16_t pix, uint32_t c) {
if (reversed) pix = _len - pix -1; if (reversed) pix = _len - pix -1;
pix += _skip; else pix += _skip;
PolyBus::setPixelColor(_busPtr, _iType, pix, c, _colorOrder); PolyBus::setPixelColor(_busPtr, _iType, pix, c, _colorOrder);
} }
uint32_t getPixelColor(uint16_t pix) { uint32_t getPixelColor(uint16_t pix) {
if (reversed) pix = _len - pix -1; if (reversed) pix = _len - pix -1;
pix += _skip; else pix += _skip;
return PolyBus::getPixelColor(_busPtr, _iType, pix, _colorOrder); return PolyBus::getPixelColor(_busPtr, _iType, pix, _colorOrder);
} }

View File

@ -350,7 +350,6 @@
<option value="2">Linear (never wrap)</option> <option value="2">Linear (never wrap)</option>
<option value="3">None (not recommended)</option> <option value="3">None (not recommended)</option>
</select><br> </select><br>
Reverse LED order (rotate 180): <input type="checkbox" name="RV"><br>
Skip first LED: <input type="checkbox" name="SL"><br> Skip first LED: <input type="checkbox" name="SL"><br>
<span class="wc"> <span class="wc">
Auto-calculate white channel from RGB:<br> Auto-calculate white channel from RGB:<br>

View File

@ -134,9 +134,8 @@ required><br>Mode: <select name="TW"><option value="0">Wait and set</option>
value="3">Sunrise</option></select><h3>Advanced</h3>Palette blending: <select value="3">Sunrise</option></select><h3>Advanced</h3>Palette blending: <select
name="PB"><option value="0">Linear (wrap if moving)</option><option value="1"> name="PB"><option value="0">Linear (wrap if moving)</option><option value="1">
Linear (always wrap)</option><option value="2">Linear (never wrap)</option> Linear (always wrap)</option><option value="2">Linear (never wrap)</option>
<option value="3">None (not recommended)</option></select><br> <option value="3">None (not recommended)</option></select><br>Skip first LED:
Reverse LED order (rotate 180): <input type="checkbox" name="RV"><br> <input type="checkbox" name="SL"><br><span class="wc">
Skip first LED: <input type="checkbox" name="SL"><br><span class="wc">
Auto-calculate white channel from RGB:<br><select name="AW"><option value="0"> Auto-calculate white channel from RGB:<br><select name="AW"><option value="0">
None</option><option value="1">Brighter</option><option value="2">Accurate None</option><option value="1">Brighter</option><option value="2">Accurate
</option><option value="3">Dual</option><option value="4">Legacy</option> </option><option value="3">Dual</option><option value="4">Legacy</option>

View File

@ -126,14 +126,14 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
} }
colorOrder = request->arg(co).toInt(); colorOrder = request->arg(co).toInt();
start = (request->hasArg(ls)) ? request->arg(ls).toInt() : 0; start = (request->hasArg(ls)) ? request->arg(ls).toInt() : 0;
ledCount += length; // ledCount += length;
// actual finalization is done in loop() // actual finalization is done in loop()
if (busConfigs[s] != nullptr) delete busConfigs[s]; if (busConfigs[s] != nullptr) delete busConfigs[s];
busConfigs[s] = new BusConfig(type, pins, start, length, colorOrder, request->hasArg(cv), skipFirstLed); busConfigs[s] = new BusConfig(type, pins, start, length, colorOrder, request->hasArg(cv), skipFirstLed);
} }
// ledCount = request->arg(F("LC")).toInt(); ledCount = request->arg(F("LC")).toInt();
// if (t > 0 && t <= MAX_LEDS) ledCount = t; // if (t > 0 && t <= MAX_LEDS) ledCount = t;
//DMA method uses too much ram, TODO: limit! //DMA method uses too much ram, TODO: limit!