Skip to content

Commit b673748

Browse files
authored
Merge branch 'MoonModules:mdev' into mdev
2 parents 886ea5f + 7d364bc commit b673748

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

pio-scripts/output_bins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def bin_rename_copy(source, target, env):
139139
shutil.copy(source_map, map_file)
140140

141141
# wledmm_print_all_defines(env)
142-
wledmm_print_build_info(env)
142+
# wledmm_print_build_info(env)
143143

144144
def bin_gzip(source, target, env):
145145
_create_dirs()

platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,11 +2476,16 @@ lib_ignore =
24762476

24772477

24782478
[env:adafruit_matrixportal_esp32s3]
2479+
; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75
24792480
extends = esp32_4MB_V4_M_base
24802481
platform = ${esp32.platformV4_xp} ;; 6.5.0 = first platform release supporting matrixportal
24812482
platform_packages = ${esp32.platformV4_packages_xp} ;; arduino-esp32 2.0.14 needed - previous versions were missing files for matrixportal
24822483
board = adafruit_matrixportal_esp32s3
24832484

2485+
board_build.partitions = ${esp32.large_partitions}
2486+
board_build.f_flash = 80000000L
2487+
board_build.flash_mode = qio
2488+
24842489
build_unflags = ${env:esp32S3_8MB_M.build_unflags} ;; use the same as "normal" S3 buildenv
24852490
build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation
24862491
${common_mm.build_flags_S}

wled00/FX.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,16 +3696,17 @@ uint16_t mode_drip(void)
36963696
if (!SEGENV.allocateData(dataSize * strips)) return mode_static(); //allocation failed
36973697
Spark* drops = reinterpret_cast<Spark*>(SEGENV.data);
36983698

3699+
if (SEGENV.call == 0) SEGMENT.fill(BLACK); // WLEDMM clear LEDs at startup
36993700
if (!SEGMENT.check2) SEGMENT.fill(SEGCOLOR(1));
37003701

37013702
struct virtualStrip {
37023703
static void runStrip(uint16_t stripNr, Spark* drops) {
37033704

37043705
uint8_t numDrops = 1 + (SEGMENT.intensity >> 6); // 255>>6 = 3
37053706

3706-
float gravity = -0.0005 - (SEGMENT.speed/25000.0); //increased gravity (50000 to 25000)
3707-
gravity *= max(1, SEGLEN-1);
3708-
int sourcedrop = 12;
3707+
float gravity = -0.0005f - (float(SEGMENT.speed)/35000.0f); //increased gravity (50000 to 35000)
3708+
gravity *= min(max(1, SEGLEN-1), 255); //WLEDMM speed limit 255
3709+
const int sourcedrop = 12;
37093710

37103711
for (int j=0;j<numDrops;j++) {
37113712
if (drops[j].colIndex == 0) { //init
@@ -3724,24 +3725,26 @@ uint16_t mode_drip(void)
37243725

37253726
drops[j].col += map(SEGMENT.custom1, 0, 255, 1, 6); // swelling
37263727

3727-
if (random16() <= drops[j].col * SEGMENT.custom1 * SEGMENT.custom1 / 10 / 128) { // random drop
3728+
uint32_t fallrate = (drops[j].col * (1 + SEGMENT.custom1 * SEGMENT.custom1)) / 192; // WLEDMM specific
3729+
if (random16() <= (fallrate / 10)) { // random drop => 1% ... 20% probalibity
37283730
drops[j].colIndex=2; //fall
37293731
drops[j].col=255;
37303732
}
37313733
}
37323734
if (drops[j].colIndex > 1) { // falling
3733-
if (drops[j].pos > 0) { // fall until end of segment
3735+
if (drops[j].pos > 0.01f) { // fall until end of segment
37343736
drops[j].pos += drops[j].vel;
37353737
if (drops[j].pos < 0) drops[j].pos = 0;
37363738
drops[j].vel += gravity; // gravity is negative
37373739

37383740
for (int i=1;i<7-drops[j].colIndex;i++) { // some minor math so we don't expand bouncing droplets
3739-
uint16_t pos = constrain(uint16_t(drops[j].pos) +i, 0, SEGLEN-1); //this is BAD, returns a pos >= SEGLEN occasionally
3741+
int intPos = roundf(drops[j].pos) +i; // WLEDMM round it first
3742+
uint16_t pos = constrain(intPos, 0, SEGLEN-1); //this is BAD, returns a pos >= SEGLEN occasionally // WLEDMM bad cast to uint16_t removed
37403743
SEGMENT.setPixelColor(indexToVStrip(pos, stripNr), color_blend(BLACK,dropColor,drops[j].col/i)); //spread pixel with fade while falling
37413744
}
37423745

37433746
if (drops[j].colIndex > 2) { // during bounce, some water is on the floor
3744-
SEGMENT.setPixelColor(indexToVStrip(0, stripNr), color_blend(dropColor,BLACK,drops[j].col));
3747+
SEGMENT.setPixelColor(indexToVStrip(0, stripNr), color_blend(dropColor,BLACK, (2 * drops[j].col)/3)); // WLEDMM reduced brightness
37453748
}
37463749
} else { // we hit bottom
37473750
if (drops[j].colIndex > 2) { // already hit once, so back to forming
@@ -3768,7 +3771,7 @@ uint16_t mode_drip(void)
37683771

37693772
return FRAMETIME;
37703773
}
3771-
static const char _data_FX_MODE_DRIP[] PROGMEM = "Drip@Gravity,# of drips,,,,,Overlay;!,!;!;1.5d;m12=1"; //bar WLEDMM 1.5d
3774+
static const char _data_FX_MODE_DRIP[] PROGMEM = "Drip@Gravity,# of drips,Fall ratio,,,,Overlay;!,!;!;1.5d;c1=127,m12=1"; //bar WLEDMM 1.5d
37723775

37733776

37743777
/*

wled00/wled.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
// version code in format yymmddb (b = daily build)
11-
#define VERSION 2405240
11+
#define VERSION 2405241
1212

1313
// WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED.
1414
#define _MoonModules_WLED_

0 commit comments

Comments
 (0)