Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix POV Display usermod #4427

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix POV Display usermod
  • Loading branch information
Liliputech authored and Arthur Suzuki committed Dec 25, 2024
commit 001b882e11e6d70f104c6984f94b35ff53c93659
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
}
Loading