From 07fdeb3ab76443c6b452ee8839205b7dddb5276c Mon Sep 17 00:00:00 2001 From: Ewoud Date: Tue, 13 Jun 2023 17:58:00 +0200 Subject: [PATCH] Ledmaps without width and height specified --- wled00/FX_fcn.cpp | 16 +++++++--------- wled00/wled.h | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 780376d0..6e6fa5ed 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -2204,7 +2204,7 @@ bool WS2812FX::deserializeMap(uint8_t n) { USER_PRINT(F("Reading LED map from ")); //WLEDMM use USER_PRINT USER_PRINTLN(fileName); - //WLEDMM: read width and height (mandatory in file!!) + //WLEDMM: read width and height f.find("\"width\":"); f.readBytesUntil('\n', fileName, sizeof(fileName)); //hack: use fileName as we have this allocated already uint16_t maxWidth = atoi(fileName); @@ -2214,15 +2214,13 @@ bool WS2812FX::deserializeMap(uint8_t n) { uint16_t maxHeight = atoi(fileName); USER_PRINTF("deserializeMap %d x %d\n", maxWidth, maxHeight); - if (maxWidth * maxHeight <= 0) { - releaseJSONBufferLock(); - return false; - } - //WLEDMM: support ledmap file properties width and height - Segment::maxWidth = maxWidth; - Segment::maxHeight = maxHeight; - resetSegments(true); //WLEDMM not makeAutoSegments() as we only want to change bounds + //WLEDMM: support ledmap file properties width and height: if found change segment + if (maxWidth * maxHeight > 0) { + Segment::maxWidth = maxWidth; + Segment::maxHeight = maxHeight; + resetSegments(true); //WLEDMM not makeAutoSegments() as we only want to change bounds + } //WLEDMM recreate customMappingTable if more space needed if (Segment::maxWidth * Segment::maxHeight > customMappingTableSize) { diff --git a/wled00/wled.h b/wled00/wled.h index b2c70525..79c0bfcc 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2306081 +#define VERSION 2306130 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG