Fixed virtual getPixelColor() returning scaled values

This commit is contained in:
cschwinne 2021-10-03 22:01:50 +02:00
parent 9e5d45d0de
commit 330da137db
3 changed files with 6 additions and 8 deletions

View File

@ -408,12 +408,11 @@ class BusNetwork : public Bus {
uint32_t getPixelColor(uint16_t pix) {
if (!_valid || pix >= _len) return 0;
uint16_t offset = pix * _UDPchannels;
// behave as NeoPixelBus
return (
(_rgbw ? (scale8(_data[offset+3], _bri) << 24) : 0)
| (scale8(_data[offset] , _bri) << 16)
| (scale8(_data[offset+1], _bri) << 8)
| (scale8(_data[offset+2], _bri) )
(_rgbw ? (_data[offset+3] << 24) : 0)
| (_data[offset] << 16)
| (_data[offset+1] << 8)
| (_data[offset+2] )
);
}
@ -549,7 +548,6 @@ class BusManager {
uint16_t bstart = b->getStart();
if (pix < bstart || pix >= bstart + b->getLength()) continue;
busses[i]->setPixelColor(pix - bstart, c);
break;
}
}

View File

@ -322,7 +322,7 @@ ${i+1}:
<option value="5">GBR</option>
</select></div>
<br>
<span id="psd${i}">Start:</span> <input type="number" name="LS${i}" id="ls${i}" class="l starts" min="0" max="8191" value="${lastEnd(i)}" oninput="UI();startsDirty[${i}]=true;" required />&nbsp;
<span id="psd${i}">Start:</span> <input type="number" name="LS${i}" id="ls${i}" class="l starts" min="0" max="8191" value="${lastEnd(i)}" oninput="startsDirty[${i}]=true;UI();" required />&nbsp;
<div id="dig${i}c" style="display:inline">Length: <input type="number" name="LC${i}" class="l" min="1" max="${maxPB}" value="1" required oninput="UI()" /></div>
<br>
<span id="p0d${i}">GPIO:</span> <input type="number" name="L0${i}" min="0" max="33" required class="xs" onchange="UI()"/>

File diff suppressed because one or more lines are too long