Skip to content
Merged
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
37 changes: 16 additions & 21 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ class WS2812FX {
#endif
correctWB(false),
cctFromRgb(false),
_currentSegment(nullptr),
// true private variables
_pixels(nullptr),
_pixelCCT(nullptr),
Expand All @@ -846,14 +847,14 @@ class WS2812FX {
_isOffRefreshRequired(false),
_hasWhiteChannel(false),
_triggered(false),
_modeCount(MODE_COUNT),
_segment_index(0),
_mainSegment(0),
_modeCount(MODE_COUNT),
_callback(nullptr),
customMappingTable(nullptr),
customMappingSize(0),
customMappingTable(nullptr),
_lastShow(0),
_lastServiceShow(0)
_lastServiceShow(0),
_callback(nullptr)
{
_mode.reserve(_modeCount); // allocate memory to prevent initial fragmentation (does not increase size())
_modeData.reserve(_modeCount); // allocate memory to prevent initial fragmentation (does not increase size())
Expand Down Expand Up @@ -1003,11 +1004,9 @@ class WS2812FX {
// end 2D support

bool isMatrix;
struct {
bool autoSegments : 1;
bool correctWB : 1;
bool cctFromRgb : 1;
};
bool autoSegments;
bool correctWB;
bool cctFromRgb;

Segment *_currentSegment;

Expand All @@ -1026,28 +1025,24 @@ class WS2812FX {
uint16_t _cumulativeFps;
uint8_t _targetFps;

// will require only 1 byte
struct {
bool _isServicing : 1;
bool _isOffRefreshRequired : 1; //periodic refresh is required for the strip to remain off.
bool _hasWhiteChannel : 1;
bool _triggered : 1;
};

uint8_t _segment_index;
uint8_t _mainSegment;
bool _isServicing;
bool _isOffRefreshRequired; //periodic refresh is required for the strip to remain off.
bool _hasWhiteChannel ;
bool _triggered;

uint8_t _modeCount;
std::vector<mode_ptr> _mode; // SRAM footprint: 4 bytes per element
std::vector<const char*> _modeData; // mode (effect) name and its slider control data array

show_callback _callback;
uint8_t _segment_index;
uint8_t _mainSegment;

uint16_t* customMappingTable;
uint16_t customMappingSize;
uint16_t* customMappingTable;

unsigned long _lastShow;
unsigned long _lastServiceShow;
show_callback _callback;

friend class Segment;
};
Expand Down
6 changes: 3 additions & 3 deletions wled00/FXparticleSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class ParticleSystem2D {
void getParticleXYsize(PSadvancedParticle *advprops, PSsizeControl *advsize, uint32_t &xsize, uint32_t &ysize);
[[gnu::hot]] void bounce(int8_t &incomingspeed, int8_t &parallelspeed, int32_t &position, const uint32_t maxposition); // bounce on a wall
// note: variables that are accessed often are 32bit for speed
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
PSsettings2D particlesettings; // settings used when updating particles (can also used by FX to move sources), do not edit properties directly, use functions above
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
uint32_t numParticles; // total number of particles allocated by this system
uint32_t emitIndex; // index to count through particles to emit so searching for dead pixels is faster
int32_t collisionHardness;
Expand Down Expand Up @@ -397,17 +397,17 @@ class ParticleSystem1D
//void updateSize(PSadvancedParticle *advprops, PSsizeControl *advsize); // advanced size control
[[gnu::hot]] void bounce(int8_t &incomingspeed, int8_t &parallelspeed, int32_t &position, const uint32_t maxposition); // bounce on a wall
// note: variables that are accessed often are 32bit for speed
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
PSsettings1D particlesettings; // settings used when updating particles
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
uint32_t numParticles; // total number of particles allocated by this system
uint32_t emitIndex; // index to count through particles to emit so searching for dead pixels is faster
int32_t collisionHardness;
uint32_t particleHardRadius; // hard surface radius of a particle, used for collision detection
uint32_t wallHardness;
uint16_t collisionStartIdx; // particle array start index for collision detection
uint8_t gforcecounter; // counter for global gravity
int8_t gforce; // gravity strength, default is 8 (negative is allowed, positive is downwards)
uint8_t forcecounter; // counter for globally applied forces
uint16_t collisionStartIdx; // particle array start index for collision detection
//global particle properties for basic particles
uint8_t particlesize; // global particle size, 0 = 1 pixel, 1 = 2 pixels, is overruled by advanced particle size
uint8_t motionBlur; // enable motion blur, values > 100 gives smoother animations
Expand Down
8 changes: 3 additions & 5 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,9 @@ struct Button {
unsigned long pressedTime; // time button was pressed
unsigned long waitTime; // time to wait for next button press
int8_t pin; // pin number
struct {
uint8_t type : 6; // button type (push, long, double, etc.)
bool pressedBefore : 1; // button was pressed before
bool longPressed : 1; // button was long pressed
};
uint8_t type; // button type (push, long, double, etc.)
bool pressedBefore; // button was pressed before
bool longPressed; // button was long pressed
uint8_t macroButton; // macro/preset to call on button press
uint8_t macroLongPress; // macro/preset to call on long press
uint8_t macroDoublePress; // macro/preset to call on double press
Expand Down
Loading