Skip to content

Commit 5e2fde1

Browse files
committed
fixed typos, warnings and compilation errors
1 parent eae42af commit 5e2fde1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

wled00/FX.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9692,7 +9692,7 @@ uint16_t mode_particleBalance(void) {
96929692

96939693
// Particle System settings
96949694
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
9695-
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
9695+
PartSys->setMotionBlur(SEGMENT.custom2); // enable motion blur
96969696
PartSys->setBounce(!SEGMENT.check2);
96979697
PartSys->setWrap(SEGMENT.check2);
96989698
uint8_t hardness = SEGMENT.custom1 > 0 ? map(SEGMENT.custom1, 0, 255, 50, 250) : 200; // set hardness, make the walls hard if collisions are disabled
@@ -10193,7 +10193,7 @@ uint16_t mode_particle1DsonicBoom(void) {
1019310193
for (uint32_t i = 0; i < PartSys->usedParticles; i++) {
1019410194
if (SEGMENT.check1) { // modulate colors by mid frequencies
1019510195
int mids = sqrt32_bw((int)fftResult[5] + (int)fftResult[6] + (int)fftResult[7] + (int)fftResult[8] + (int)fftResult[9] + (int)fftResult[10]); // average the mids, bin 5 is ~500Hz, bin 10 is ~2kHz (see audio_reactive.h)
10196-
PartSys->particles[i].hue += (mids * inoise8(PartSys->particles[i].x << 2, SEGMENT.step << 2)) >> 9; // color by perlin noise from mid frequencies
10196+
PartSys->particles[i].hue += (mids * perlin8(PartSys->particles[i].x << 2, SEGMENT.step << 2)) >> 9; // color by perlin noise from mid frequencies
1019710197
}
1019810198
if (PartSys->particles[i].ttl > 16) {
1019910199
PartSys->particles[i].ttl -= 16; //ttl is linked to brightness, this allows to use higher brightness but still a (very) short lifespan
@@ -10206,7 +10206,7 @@ uint16_t mode_particle1DsonicBoom(void) {
1020610206
if (SEGMENT.custom2 < 128) // fixed position
1020710207
PartSys->sources[0].source.x = map(SEGMENT.custom2, 0, 127, 0, PartSys->maxX);
1020810208
else if (SEGMENT.custom2 < 255) { // advances on each "beat"
10209-
int32_t step = PartSys->maxX / ((262 - (SEGMENT.custom2) >> 2)); // step: 2 - 33 steps for full segment width
10209+
int32_t step = PartSys->maxX / (((262 - SEGMENT.custom2) >> 2)); // step: 2 - 33 steps for full segment width
1021010210
PartSys->sources[0].source.x = (PartSys->sources[0].source.x + step) % PartSys->maxX;
1021110211
if (PartSys->sources[0].source.x < step) // align to be symmetrical by making the first position half a step from start
1021210212
PartSys->sources[0].source.x = step >> 1;
@@ -10317,7 +10317,7 @@ uint16_t mode_particleSpringy(void) {
1031710317
PartSys->applyForce(PartSys->particles[i], springforce[i], PartSys->advPartProps[i].forcecounter);
1031810318
//dampen slow particles to avoid persisting oscillations on higher stiffness
1031910319
if (dampenoscillations) {
10320-
if (abs(PartSys->particles[i].vx) < 3 && abs(springforce[i] < (springK >> 2)))
10320+
if (abs(PartSys->particles[i].vx) < 3 && abs(springforce[i]) < (springK >> 2))
1032110321
PartSys->particles[i].vx = (PartSys->particles[i].vx * 254) / 256; // take out some energy
1032210322
}
1032310323
PartSys->particles[i].ttl = 300; // reset ttl, cannot use perpetual
@@ -10379,7 +10379,7 @@ uint16_t mode_particleSpringy(void) {
1037910379

1038010380
for (int32_t i = 0; i < PartSys->usedParticles; i++) {
1038110381
if (SEGMENT.custom2 == 255) { // map speed to hue
10382-
int speedclr = (abs(PartSys->particles[i].vx) >> 2) << 4; // scale for greater color variation, dump small values to avoid flickering
10382+
int speedclr = ((int8_t(abs(PartSys->particles[i].vx))) >> 2) << 4; // scale for greater color variation, dump small values to avoid flickering
1038310383
//int speed = PartSys->particles[i].vx << 2; // +/- 512
1038410384
if (speedclr > 240) speedclr = 240; // limit color to non-wrapping part of palette
1038510385
PartSys->particles[i].hue = speedclr;

0 commit comments

Comments
 (0)