Ledmaps without width and height specified

This commit is contained in:
Ewoud
2023-06-13 17:58:00 +02:00
parent 794e3a8671
commit 07fdeb3ab7
2 changed files with 8 additions and 10 deletions

View File

@@ -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) {

View File

@@ -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