Fix LedWiz lower half of brightness range emitting no light#57
Conversation
|
Heads-up for reviewers/testers: this is verified against the DirectOutput C# source — the active Could a LedWiz owner confirm on hardware? Quick check with this branch:
Happy to adjust if it behaves differently than the C# leads me to expect. |
|
Hello. Thanks for the PR! Converting this to draft as per the contributing rules. (I was behind in getting them added as was just done in Visual Pinball). It's going to take time to review these. libdof is currently is use by several users with a variety of devices, and we have yet to receive issues about this. Also this definitely needs thorough testing with the actual hardware. |
UpdateOutputs set the SBA on/off switch bit only for output values > 127, while the PBA brightness is set for the actual value -- so every value 1-127 got a brightness but the port stayed switched OFF (no light; a hard cliff at 128, lower half of every fade lost). C# switches on for any nonzero value (ByteToLedWizValue[1]=1, S = V != 0). Use > 0 to match.
e548734 to
dfd6578
Compare
Fix
UpdateOutputsset the SBA on/off switch bit only for output values> 127, while the PBA brightness is set for the actual value. So every output value 1–127 gets a brightness but leaves the port switched off — no light. Change the threshold to> 0.Why it matters
A hard cliff at 128 — the entire lower half of the range emits no light, so every DOF fade loses its bottom half and dim/ramp effects vanish. C# switches on for any nonzero value:
byte V = ByteToLedWizValue[Value]; bool S = (V != 0);, and the active table maps[1..255]all to ≥ 1. Affects every LedWiz — the most common DOF controller.Found by diffing against the DirectOutput C# source.