Skip to content

Commit

Permalink
bugfix initEffect only for effect change, not for projection change
Browse files Browse the repository at this point in the history
cleanup model.json

LedModEffects: bugfix initEffect only for effect change, not for projection change
  • Loading branch information
ewoudwijma committed Oct 9, 2024
1 parent bc475f2 commit def6421
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 43 deletions.
46 changes: 7 additions & 39 deletions misc/model.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@
"pid": "clients",
"ro": true,
"max": 999,
"pid": "clTbl",
"o": 72,
"fun": 53
},
Expand All @@ -332,7 +331,6 @@
"pid": "clients",
"ro": true,
"max": 16,
"pid": "clTbl",
"o": 73,
"fun": 54
},
Expand All @@ -358,7 +356,6 @@
"pid": "clients",
"ro": true,
"max": 64,
"pid": "clTbl",
"o": 76,
"fun": 57
}
Expand Down Expand Up @@ -443,7 +440,6 @@
"max": 255,
"value": 0,
"o": 85,
"pid": "ethConfig",
"fun": 64
},
{
Expand All @@ -454,7 +450,6 @@
"max": 40,
"value": 14,
"o": 86,
"pid": "ethConfig",
"fun": 65
},
{
Expand All @@ -465,7 +460,6 @@
"max": 40,
"value": 23,
"o": 87,
"pid": "ethConfig",
"fun": 66
},
{
Expand All @@ -476,7 +470,6 @@
"max": 40,
"value": 18,
"o": 88,
"pid": "ethConfig",
"fun": 67
},
{
Expand All @@ -486,7 +479,6 @@
"ro": false,
"value": 0,
"o": 89,
"pid": "ethConfig",
"fun": 68
},
{
Expand All @@ -496,11 +488,9 @@
"ro": false,
"value": 3,
"o": 90,
"pid": "ethConfig",
"fun": 69
}
],
"pid": "ethOn",
"o": 84,
"fun": 63
},
Expand All @@ -510,7 +500,6 @@
"pid": "ethernet",
"ro": true,
"max": 32,
"pid": "ethOn",
"o": 91,
"fun": 70
}
Expand All @@ -532,7 +521,6 @@
"ro": false,
"max": 31,
"value": "ewtr",
"pid": "wifiOn",
"o": 93,
"fun": 72
},
Expand All @@ -543,7 +531,6 @@
"ro": false,
"max": 63,
"value": "zonledmod",
"pid": "wifiOn",
"o": 94,
"fun": 73
},
Expand All @@ -553,7 +540,6 @@
"pid": "wiFi",
"ro": true,
"max": 32,
"pid": "wifiOn",
"o": 95,
"fun": 74
},
Expand All @@ -563,7 +549,6 @@
"pid": "wiFi",
"ro": true,
"max": 32,
"pid": "wifiOn",
"o": 96,
"fun": 75
}
Expand All @@ -584,7 +569,6 @@
"pid": "AP",
"ro": true,
"max": 32,
"pid": "apOn",
"o": 98,
"fun": 77
}
Expand Down Expand Up @@ -639,7 +623,6 @@
"ro": true,
"min": 1,
"max": 512,
"pid": "e131Tbl",
"o": 110,
"fun": 86
},
Expand All @@ -649,7 +632,6 @@
"pid": "watches",
"ro": true,
"max": 32,
"pid": "e131Tbl",
"o": 111,
"fun": 87
},
Expand All @@ -667,7 +649,6 @@
"pid": "watches",
"ro": true,
"max": 255,
"pid": "e131Tbl",
"o": 113,
"fun": 89
}
Expand Down Expand Up @@ -771,7 +752,6 @@
"pid": "loops",
"ro": true,
"max": 32,
"pid": "vlTbl",
"o": 124,
"fun": 97
},
Expand All @@ -781,7 +761,6 @@
"pid": "loops",
"ro": true,
"max": 999,
"pid": "vlTbl",
"o": 125,
"fun": 98
}
Expand Down Expand Up @@ -811,7 +790,6 @@
"pid": "instances",
"ro": false,
"max": 32,
"pid": "insTbl",
"o": 130,
"fun": 101
},
Expand All @@ -837,7 +815,6 @@
"pid": "instances",
"ro": true,
"max": 16,
"pid": "insTbl",
"o": 133,
"fun": 104
},
Expand All @@ -847,7 +824,6 @@
"pid": "instances",
"ro": true,
"max": 16,
"pid": "insTbl",
"o": 134,
"fun": 105
},
Expand All @@ -857,7 +833,6 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 135,
"fun": 106
},
Expand All @@ -867,7 +842,6 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 136,
"fun": 107
},
Expand All @@ -877,7 +851,6 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 137,
"fun": 108
},
Expand All @@ -887,7 +860,6 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 138,
"fun": 109
},
Expand All @@ -897,7 +869,6 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 139,
"fun": 110
},
Expand All @@ -907,53 +878,50 @@
"pid": "instances",
"ro": true,
"max": -1,
"pid": "insTbl",
"o": 140,
"fun": 111
},
{
"id": "inson",
"id": "on",
"type": "checkbox",
"pid": "instances",
"ro": false,
"o": 104,
"fun": 85
},
{
"id": "insbrightness",
"id": "brightness",
"type": "range",
"pid": "instances",
"ro": false,
"max": 255,
"log": true,
"pid": "insTbl",
"o": 143,
"fun": 114
},
{
"id": "insdch",
"id": "channel",
"type": "number",
"pid": "instances",
"ro": false,
"min": 1,
"max": 512,
"pid": "insTbl",
"o": 141,
"fun": 112
},
{
"id": "insfx",
"id": "effect",
"type": "select",
"ro": false,
"pid": "insTbl",
"pid": "instances",
"o": 144,
"fun": 115
},
{
"id": "inspro",
"id": "projection",
"type": "select",
"ro": false,
"pid": "insTbl",
"pid": "instances",
"o": 145,
"fun": 116
}
Expand Down
12 changes: 8 additions & 4 deletions src/App/LedModEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class LedModEffects:public SysModule {

bool driverShow = true;

uint8_t doInitEffectRowNr = UINT8_MAX;

#ifdef STARLIGHT_CLOCKLESS_LED_DRIVER
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
I2SClocklessLedDriveresp32S3 driver;
Expand Down Expand Up @@ -238,6 +240,7 @@ class LedModEffects:public SysModule {
leds->effectDimension = effect->dim();
leds->triggerMapping();
//initEffect is called after mapping done to make sure dimensions are right before controls are done...
doInitEffectRowNr = rowNr;
}
else {
initEffect(*leds, rowNr);
Expand Down Expand Up @@ -573,15 +576,16 @@ class LedModEffects:public SysModule {
void mapInitAlloc() {
fixture.projectAndMap();

//reinit the effect after a mapping change

//reinit the effect after an effect change causing a mapping change
uint8_t rowNr = 0;
for (LedsLayer *leds: fixture.layers) {
initEffect(*leds, rowNr);
if (doInitEffectRowNr == rowNr) {
doInitEffectRowNr = UINT8_MAX;
initEffect(*leds, rowNr);
}
rowNr++;
}


//https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples

//connect allocated Pins to gpio
Expand Down

0 comments on commit def6421

Please sign in to comment.