Skip to content

Commit

Permalink
fix sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 24, 2021
1 parent 099d404 commit 23c43d7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Marlin/src/feature/leds/leds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void LEDLights::set_color(const LEDColor &incol
const uint32_t neocolor = LEDColorWhite() == incol
? neo.Color(NEO_WHITE)
: neo.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_LED, incol.w));

static uint16_t nextLed = 0;

#ifdef NEOPIXEL_BKGD_INDEX_FIRST
Expand All @@ -98,12 +99,14 @@ void LEDLights::set_color(const LEDColor &incol

neo.set_brightness(incol.i);

if (isSequence) {
neo.set_pixel_color(nextLed, neocolor);
neo.show();
if (++nextLed >= neo.pixels()) nextLed = 0;
return;
}
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
if (isSequence) {
neo.set_pixel_color(nextLed, neocolor);
neo.show();
if (++nextLed >= neo.pixels()) nextLed = 0;
return;
}
#endif

neo.set_color(neocolor);

Expand Down

0 comments on commit 23c43d7

Please sign in to comment.