Skip to content

Commit f644a02

Browse files
committed
Fix autostart when using hardware input
1 parent 9b4f124 commit f644a02

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/FastLEDHub.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ FastLEDHubClass::FastLEDHubClass() : m_cycleButtonPushed(false),
1111
m_gammaCorrectionEnabled(false),
1212
m_filteredBrightness(128),
1313
m_status(STOPPED),
14+
m_brightness(255),
1415
m_speed(255),
1516
m_potentiometerPin(-1),
1617
m_cycleButtonPin(-1),
17-
m_toggleButtonPin(-1),
18-
m_brightness(255)
18+
m_toggleButtonPin(-1)
1919
{
2020
}
2121

@@ -281,7 +281,9 @@ String FastLEDHubClass::getCurrentAnimationName()
281281

282282
void FastLEDHubClass::autostart()
283283
{
284-
if (Config.startupAnimation != "")
284+
if (Config.startupAnimation == "")
285+
clear(true);
286+
else
285287
begin(getAnimation(Config.startupAnimation));
286288

287289
m_autostartHandled = true;

src/FastLEDHub.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ class FastLEDHubClass : public CFastLED
183183
Ticker m_inputTicker;
184184
Animation *m_currentAnimation;
185185
AnimationStatus m_status = STOPPED;
186-
uint8_t m_speed;
187-
uint8_t m_potentiometerPin;
188-
uint8_t m_cycleButtonPin;
189-
uint8_t m_toggleButtonPin;
190186
uint8_t m_brightness;
187+
uint8_t m_speed;
188+
int8_t m_potentiometerPin;
189+
int8_t m_cycleButtonPin;
190+
int8_t m_toggleButtonPin;
191191
};
192192

193193
extern FastLEDHubClass FastLEDHub;

0 commit comments

Comments
 (0)