Skip to content

Commit

Permalink
leds: fix incorrect handling of RGB LEDs
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Apr 27, 2021
1 parent 2ac70ff commit 0f11712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/application/io/leds/LEDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ void LEDs::setColor(uint8_t ledID, color_t color, brightness_t brightness)
uint8_t gLED = _hwa.rgbSingleComponentIndex(rgbIndex, rgbIndex_t::g);
uint8_t bLED = _hwa.rgbSingleComponentIndex(rgbIndex, rgbIndex_t::b);

handleLED(rLED, rgbIndex_t::r, BIT_READ(static_cast<bool>(color), static_cast<uint8_t>(rgbIndex_t::r)), true);
handleLED(gLED, rgbIndex_t::g, BIT_READ(static_cast<bool>(color), static_cast<uint8_t>(rgbIndex_t::g)), true);
handleLED(bLED, rgbIndex_t::b, BIT_READ(static_cast<bool>(color), static_cast<uint8_t>(rgbIndex_t::b)), true);
handleLED(rLED, rgbIndex_t::r, BIT_READ(static_cast<uint8_t>(color), static_cast<uint8_t>(rgbIndex_t::r)), true);
handleLED(gLED, rgbIndex_t::g, BIT_READ(static_cast<uint8_t>(color), static_cast<uint8_t>(rgbIndex_t::g)), true);
handleLED(bLED, rgbIndex_t::b, BIT_READ(static_cast<uint8_t>(color), static_cast<uint8_t>(rgbIndex_t::b)), true);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ class HWALEDs : public IO::LEDs::HWA
break;

case IO::LEDs::rgbIndex_t::g:
boardRGBindex = Board::io::rgbIndex_t::r;
boardRGBindex = Board::io::rgbIndex_t::g;
break;

case IO::LEDs::rgbIndex_t::b:
boardRGBindex = Board::io::rgbIndex_t::b;
break;
Expand Down

0 comments on commit 0f11712

Please sign in to comment.