Skip to content

Commit

Permalink
Stack 16KB only if live scripts,
Browse files Browse the repository at this point in the history
LedModFixture:
- mapInitAlloc default fixture: use available fixSize (set externally), setPin if defined
- driverShow: FastLED.show: only if initLeds done
  • Loading branch information
ewowi committed Jan 12, 2025
1 parent b29eb3d commit 184d238
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 16 additions & 9 deletions src/App/LedModFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,27 @@
}//Live Fixture
} //if fileName
else {
ppf("mapInitAlloc: Filename for fixture %d not found show default 16x16 panel\n", fixtureNr);
nrOfLeds = fixSize.x * fixSize.y * fixSize.z;
ppf("mapInitAlloc: Filename for fixture %d not found show default %dx%dx%d panel\n", fixtureNr, fixSize.x, fixSize.y, fixSize.z);

//first count then setup
for (pass = 1; pass <=2; pass++)
{
addPixelsPre();
//pass1: set nrOfLeds and use available fixSize

pass = 2;
addPixelsPre();

for (uint16_t y = 0; y < 16; y++) {
for (uint16_t x = 0; x < 16; x++) {
for (uint16_t z = 0; z < fixSize.z; z++) {
for (uint16_t y = 0; y < fixSize.y; y++) {
for (uint16_t x = 0; x < fixSize.x; x++) {
addPixel({x,y,0});
}
}

addPixelsPost();
}

if (currPin != UINT8_MAX)
addPin(currPin); //make sure

addPixelsPost();
}

} //mapInitAlloc
Expand Down Expand Up @@ -1131,7 +1137,8 @@ void LedModFixture::addPixelsPost() {
}

void LedModFixture::driverShow() {
FastLED.show();
if (FastLED.count())
FastLED.show();
}

#endif
4 changes: 3 additions & 1 deletion src/mainStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ UserModMDNS *mdns;
UserModAudioSync *audioSync;
#endif

SET_LOOP_TASK_STACK_SIZE(16 * 1024); // 16KB
#ifdef STARBASE_USERMOD_LIVE
SET_LOOP_TASK_STACK_SIZE(16 * 1024); // 16KB, otherwise 8K, to allow multiple scripts loaded at boot
#endif

//setup all modules
void setupStar() {
Expand Down

0 comments on commit 184d238

Please sign in to comment.