Skip to content

Commit

Permalink
fix POV Display usermod
Browse files Browse the repository at this point in the history
  • Loading branch information
Liliputech authored and Arthur Suzuki committed Dec 25, 2024
1 parent 8873832 commit 001b882
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions usermods/pov_display/usermod_pov_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include "wled.h"
#include <PNGdec.h>

PNG png;
File f;
static const char _data_FX_MODE_POV_IMAGE[] PROGMEM = "POV Image@!;;;1";

void * openFile(const char *filename, int32_t *size) {
f = WLED_FS.open(filename);
*size = f.size();
Expand Down Expand Up @@ -61,16 +65,22 @@ uint16_t mode_pov_image(void) {
return FRAMETIME;
}

class PovDisplayUsermod : public Usermod
{
public:
static const char _data_FX_MODE_POV_IMAGE[] PROGMEM = "POV Image@!;;;1";
class PovDisplayUsermod : public Usermod {
protected:
bool enabled = false; //WLEDMM
const char *_name; //WLEDMM
bool initDone = false; //WLEDMM
unsigned long lastTime = 0; //WLEDMM

PNG png;
File f;
public:
PovDisplayUsermod(const char *name, bool enabled) {
this->_name = name;
this->enabled = enabled;
} //WLEDMM

void setup() {
strip.addEffect(255, &mode_pov_image, _data_FX_MODE_POV_IMAGE);
initDone = true;
}

void loop() {
Expand Down
2 changes: 1 addition & 1 deletion wled00/usermods_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,6 @@ void registerUsermods()
#endif

#ifdef USERMOD_POV_DISPLAY
UsermodManager::add(new PovDisplayUsermod());
UsermodManager::add(new PovDisplayUsermod("Pov Display", false));
#endif
}

0 comments on commit 001b882

Please sign in to comment.