From 214d4364f11a2bb412fc76febc20d0a3406206e9 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Thu, 16 Dec 2021 23:39:49 +0100 Subject: [PATCH] Benchmark mode, allow arbitrary frame rate --- wled00/FX.cpp | 4 ++-- wled00/FX.h | 6 +++--- wled00/wasm.cpp | 10 +++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index e6639c11..3ef2d748 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -44,7 +44,7 @@ uint16_t WS2812FX::mode_static(void) { uint16_t WS2812FX::mode_custom(void) { if (SEGENV.call == 0) wasmfx.init(); wasmfx.run(); - return FRAMETIME; + return 1; } @@ -59,7 +59,7 @@ uint16_t WS2812FX::mode_benchmark(void) { i=(i+SEGMENT.speed/16+1); } - return FRAMETIME; + return 1; } diff --git a/wled00/FX.h b/wled00/FX.h index 360aa7a6..6350ccfc 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -69,7 +69,7 @@ #endif #define LED_SKIP_AMOUNT 1 -#define MIN_SHOW_DELAY 15 +#define MIN_SHOW_DELAY 1 #define NUM_COLORS 3 /* number of colors per segment */ #define SEGMENT _segments[_segment_index] @@ -914,9 +914,9 @@ const char JSON_mode_names[] PROGMEM = R"=====([ "Solid","Blink","Breathe","Wipe","Wipe Random","Random Colors","Sweep","Dynamic","Colorloop","Rainbow", "Scan","Scan Dual","Fade","Theater","Theater Rainbow","Running","Saw","Twinkle","Dissolve","Dissolve Rnd", "Sparkle","Sparkle Dark","Sparkle+","Strobe","Strobe Rainbow","Strobe Mega","Blink Rainbow","Android","Chase","Chase Random", -"Chase Rainbow","Chase Flash","Chase Flash Rnd","Rainbow Runner","Colorful","Traffic Light","Sweep Random","Running 2","Aurora","Stream", +"Chase Rainbow","Chase Flash","Chase Flash Rnd","Rainbow Runner","Colorful","Traffic Light","Sweep Random","Chase 2","Aurora","Stream", "Scanner","Lighthouse","Fireworks","Rain","Tetrix","Fire Flicker","Gradient","Loading","Police","Police All", -"Two Dots","Two Areas","Running Dual","Halloween","Tri Chase","Tri Wipe","Tri Fade","Lightning","ICU","Multi Comet", +"Two Dots","Two Areas","Running Dual","Halloween","Chase 3","Tri Wipe","Tri Fade","Lightning","ICU","Multi Comet", "Scanner Dual","Stream 2","Oscillate","Pride 2015","Juggle","Palette","Fire 2012","Colorwaves","Bpm","Fill Noise", "Noise 1","Noise 2","Noise 3","Noise 4","Colortwinkles","Lake","Meteor","Meteor Smooth","Railway","Ripple", "Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst", diff --git a/wled00/wasm.cpp b/wled00/wasm.cpp index e57a0016..3616c201 100644 --- a/wled00/wasm.cpp +++ b/wled00/wasm.cpp @@ -212,9 +212,7 @@ void wasm_task(void*) runtime->memoryLimit = WASM_MEMORY_LIMIT; #endif - if (wasm_buffer) { //from websockets - //app_wasm_len = wasm_buffer_len; - } else { //from filesystem (fx.wasm) + if (!wasm_buffer) { //from filesystem (fx.wasm) wasm_buffer_len = MAX_WASM_BIN_SIZE; if (!readToBuffer("/fx.wasm", &wasm_buffer, &wasm_buffer_len)) { result = "fload"; @@ -269,15 +267,13 @@ void wasmRun() { if (wasm_state != WASM_STATE_READY) return; if (result) { - //Serial.println(F("You fucked up... Majorly...")); - Serial.print("If only... "); + Serial.print("WASM run error"); Serial.println(result); - //Serial.println("That could save us🥺"); wasm_state = WASM_STATE_ERROR; return; } - result = m3_CallV (fu); + result = m3_CallV(fu); if (result) { M3ErrorInfo info;