Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SetLedRaw overflow bug #415

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dev/leddriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class LedDriverPca9685
const auto on = draw_buffer_[d].leds[ch].on & (0x0FFF);
draw_buffer_[d].leds[ch].off = (on + rawBrightness) & (0x0FFF);
// full on condition
if(rawBrightness >= 0x0FFF)
if(rawBrightness + on >= 0x0FFF)
beserge marked this conversation as resolved.
Show resolved Hide resolved
draw_buffer_[d].leds[ch].on = 0x1000 | on; // set "full on" bit
else
draw_buffer_[d].leds[ch].on = on; // clear "full on" bit
Expand Down