Skip to content

Commit ce44827

Browse files
committed
fix POV Display usermod
1 parent 48958cc commit ce44827

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

usermods/pov_display/usermod_pov_display.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "wled.h"
33
#include <PNGdec.h>
44

5+
PNG png;
6+
File f;
7+
static const char _data_FX_MODE_POV_IMAGE[] PROGMEM = "POV Image@!;;;1";
8+
59
void * openFile(const char *filename, int32_t *size) {
610
f = WLED_FS.open(filename);
711
*size = f.size();
@@ -61,16 +65,22 @@ uint16_t mode_pov_image(void) {
6165
return FRAMETIME;
6266
}
6367

64-
class PovDisplayUsermod : public Usermod
65-
{
66-
public:
67-
static const char _data_FX_MODE_POV_IMAGE[] PROGMEM = "POV Image@!;;;1";
68+
class PovDisplayUsermod : public Usermod {
69+
protected:
70+
bool enabled = false; //WLEDMM
71+
const char *_name; //WLEDMM
72+
bool initDone = false; //WLEDMM
73+
unsigned long lastTime = 0; //WLEDMM
6874

69-
PNG png;
70-
File f;
75+
public:
76+
PovDisplayUsermod(const char *name, bool enabled) {
77+
this->_name = name;
78+
this->enabled = enabled;
79+
} //WLEDMM
7180

7281
void setup() {
7382
strip.addEffect(255, &mode_pov_image, _data_FX_MODE_POV_IMAGE);
83+
initDone = true;
7484
}
7585

7686
void loop() {

wled00/usermods_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void registerUsermods()
473473
#endif
474474

475475
#ifdef USERMOD_POV_DISPLAY
476-
UsermodManager::add(new PovDisplayUsermod());
476+
UsermodManager::add(new PovDisplayUsermod("Pov Display", false));
477477
#endif
478478

479479
#ifdef USERMOD_DEEP_SLEEP

0 commit comments

Comments
 (0)