Skip to content

Commit

Permalink
Fix autostart when using hardware input
Browse files Browse the repository at this point in the history
  • Loading branch information
stnkl committed Nov 9, 2022
1 parent 9b4f124 commit f644a02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/FastLEDHub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ FastLEDHubClass::FastLEDHubClass() : m_cycleButtonPushed(false),
m_gammaCorrectionEnabled(false),
m_filteredBrightness(128),
m_status(STOPPED),
m_brightness(255),
m_speed(255),
m_potentiometerPin(-1),
m_cycleButtonPin(-1),
m_toggleButtonPin(-1),
m_brightness(255)
m_toggleButtonPin(-1)
{
}

Expand Down Expand Up @@ -281,7 +281,9 @@ String FastLEDHubClass::getCurrentAnimationName()

void FastLEDHubClass::autostart()
{
if (Config.startupAnimation != "")
if (Config.startupAnimation == "")
clear(true);
else
begin(getAnimation(Config.startupAnimation));

m_autostartHandled = true;
Expand Down
8 changes: 4 additions & 4 deletions src/FastLEDHub.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ class FastLEDHubClass : public CFastLED
Ticker m_inputTicker;
Animation *m_currentAnimation;
AnimationStatus m_status = STOPPED;
uint8_t m_speed;
uint8_t m_potentiometerPin;
uint8_t m_cycleButtonPin;
uint8_t m_toggleButtonPin;
uint8_t m_brightness;
uint8_t m_speed;
int8_t m_potentiometerPin;
int8_t m_cycleButtonPin;
int8_t m_toggleButtonPin;
};

extern FastLEDHubClass FastLEDHub;

0 comments on commit f644a02

Please sign in to comment.