diff --git a/src/App/LedEffects.h b/src/App/LedEffects.h index f00eb564..963b2e59 100644 --- a/src/App/LedEffects.h +++ b/src/App/LedEffects.h @@ -1030,7 +1030,7 @@ class Octopus: public Effect { const stackUnsigned8 mapp = 180 / max(leds.size.x,leds.size.y); // stackUnsigned8 *speed2 = leds.sharedData.bind(speed2); - // // USER_PRINTF(" %d:%d", speed2, *speed2); + // // ppf(" %d:%d", speed2, *speed2); stackUnsigned8 speed = mdl->getValue("speed"); stackUnsigned8 offsetX = mdl->getValue("Offset X"); @@ -1083,8 +1083,8 @@ class Octopus: public Effect { //bind the variables to sharedData... // stackUnsigned8 *speed2 = leds.sharedData.bind(speed2); - // USER_PRINTF("(bind %d) %d %d\n", speed2, leds.sharedData.index, leds.sharedData.bytesAllocated); - // USER_PRINTF("bind %d->%d %d\n", index, newIndex, bytesAllocated); + // ppf("(bind %d) %d %d\n", speed2, leds.sharedData.index, leds.sharedData.bytesAllocated); + // ppf("bind %d->%d %d\n", index, newIndex, bytesAllocated); //if changeValue then update the linked variable... @@ -1094,7 +1094,7 @@ class Octopus: public Effect { // , false, [leds](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun // case f_ChangeFun: { // unsigned8 *speed2 = leds.sharedData.data+0; - // USER_PRINTF("%s[%d] chFun = %s (bind %d)\n", mdl->varID(var), rowNr, var["value"].as().c_str(), speed2); + // ppf("%s[%d] chFun = %s (bind %d)\n", mdl->varID(var), rowNr, var["value"].as().c_str(), speed2); // *speed2 = var["value"][rowNr]; // return true; } // default: return false; @@ -1321,7 +1321,7 @@ class GEQEffect: public Effect { if (remaining < 1) {band++; remaining+= bandwidth;} //increase remaining but keep the current remaining remaining--; //consume remaining - // USER_PRINTF("x %d b %d n %d w %f %f\n", x, band, NUM_BANDS, bandwidth, remaining); + // ppf("x %d b %d n %d w %f %f\n", x, band, NUM_BANDS, bandwidth, remaining); stackUnsigned8 frBand = ((NUM_BANDS < 16) && (NUM_BANDS > 1)) ? map(band, 0, NUM_BANDS - 1, 0, 15):band; // always use full range. comment out this line to get the previous behaviour. // frBand = constrain(frBand, 0, 15); //WLEDMM can never be out of bounds (I think...) stackUnsigned16 colorIndex = frBand * 17; //WLEDMM 0.255 @@ -1571,27 +1571,27 @@ class Effects { void setup() { //check of no local variables (should be only 4 bytes): tbd: can we loop over effects (sizeof(effect does not work)) // for (Effect *effect:effects) { - // USER_PRINTF("Size of %s is %d\n", effect->name(), sizeof(*effect)); + // ppf("Size of %s is %d\n", effect->name(), sizeof(*effect)); // } - // USER_PRINTF("Size of %s is %d\n", "RainbowEffect", sizeof(RainbowEffect)); - // USER_PRINTF("Size of %s is %d\n", "RainbowWithGlitterEffect", sizeof(RainbowWithGlitterEffect)); - // USER_PRINTF("Size of %s is %d\n", "SinelonEffect", sizeof(SinelonEffect)); - // USER_PRINTF("Size of %s is %d\n", "RunningEffect", sizeof(RunningEffect)); - // USER_PRINTF("Size of %s is %d\n", "ConfettiEffect", sizeof(ConfettiEffect)); - // USER_PRINTF("Size of %s is %d\n", "BPMEffect", sizeof(BPMEffect)); - // USER_PRINTF("Size of %s is %d\n", "JuggleEffect", sizeof(JuggleEffect)); - // USER_PRINTF("Size of %s is %d\n", "RipplesEffect", sizeof(RipplesEffect)); - // USER_PRINTF("Size of %s is %d\n", "SphereMoveEffect", sizeof(SphereMoveEffect)); - // USER_PRINTF("Size of %s is %d\n", "Frizzles", sizeof(Frizzles)); - // USER_PRINTF("Size of %s is %d\n", "Lines", sizeof(Lines)); - // USER_PRINTF("Size of %s is %d\n", "DistortionWaves", sizeof(DistortionWaves)); - // USER_PRINTF("Size of %s is %d\n", "Octopus", sizeof(Octopus)); - // USER_PRINTF("Size of %s is %d\n", "Lissajous", sizeof(Lissajous)); - // USER_PRINTF("Size of %s is %d\n", "BouncingBalls", sizeof(BouncingBalls)); - // USER_PRINTF("Size of %s is %d\n", "RingRandomFlow", sizeof(RingRandomFlow)); + // ppf("Size of %s is %d\n", "RainbowEffect", sizeof(RainbowEffect)); + // ppf("Size of %s is %d\n", "RainbowWithGlitterEffect", sizeof(RainbowWithGlitterEffect)); + // ppf("Size of %s is %d\n", "SinelonEffect", sizeof(SinelonEffect)); + // ppf("Size of %s is %d\n", "RunningEffect", sizeof(RunningEffect)); + // ppf("Size of %s is %d\n", "ConfettiEffect", sizeof(ConfettiEffect)); + // ppf("Size of %s is %d\n", "BPMEffect", sizeof(BPMEffect)); + // ppf("Size of %s is %d\n", "JuggleEffect", sizeof(JuggleEffect)); + // ppf("Size of %s is %d\n", "RipplesEffect", sizeof(RipplesEffect)); + // ppf("Size of %s is %d\n", "SphereMoveEffect", sizeof(SphereMoveEffect)); + // ppf("Size of %s is %d\n", "Frizzles", sizeof(Frizzles)); + // ppf("Size of %s is %d\n", "Lines", sizeof(Lines)); + // ppf("Size of %s is %d\n", "DistortionWaves", sizeof(DistortionWaves)); + // ppf("Size of %s is %d\n", "Octopus", sizeof(Octopus)); + // ppf("Size of %s is %d\n", "Lissajous", sizeof(Lissajous)); + // ppf("Size of %s is %d\n", "BouncingBalls", sizeof(BouncingBalls)); + // ppf("Size of %s is %d\n", "RingRandomFlow", sizeof(RingRandomFlow)); // #ifdef STARMOD_USERMOD_WLEDAUDIO - // USER_PRINTF("Size of %s is %d\n", "GEQEffect", sizeof(GEQEffect)); - // USER_PRINTF("Size of %s is %d\n", "AudioRings", sizeof(AudioRings)); + // ppf("Size of %s is %d\n", "GEQEffect", sizeof(GEQEffect)); + // ppf("Size of %s is %d\n", "AudioRings", sizeof(AudioRings)); // #endif } @@ -1610,7 +1610,7 @@ class Effects { leds.fx = mdl->getValue(var, rowNr); - USER_PRINTF("setEffect fx[%d]: %d\n", rowNr, leds.fx); + ppf("setEffect fx[%d]: %d\n", rowNr, leds.fx); if (leds.fx < effects.size()) { @@ -1626,9 +1626,9 @@ class Effects { effect->setup(leds); //if changed then run setup once (like call==0 in WLED) - USER_PRINTF("control "); + ppf("control "); print->printVar(var); - USER_PRINTF("\n"); + ppf("\n"); if (effects[leds.fx]->dim() != leds.effectDimension) { leds.effectDimension = effects[leds.fx]->dim(); diff --git a/src/App/LedFixture.cpp b/src/App/LedFixture.cpp index 20b2c186..cc1f3d96 100644 --- a/src/App/LedFixture.cpp +++ b/src/App/LedFixture.cpp @@ -29,7 +29,7 @@ void Fixture::projectAndMap() { if (leds->doMap) { leds->fill_solid(CRGB::Black, true); //no blend - USER_PRINTF("projectAndMap clear leds[%d] fx:%d pro:%d\n", rowNr, leds->fx, leds->projectionNr); + ppf("projectAndMap clear leds[%d] fx:%d pro:%d\n", rowNr, leds->fx, leds->projectionNr); leds->size = Coord3D{0,0,0}; //vectors really gone now? for (PhysMap &map:leds->mappingTable) { @@ -75,7 +75,7 @@ void Fixture::projectAndMap() { pixel.y = (uint16CollectList.size()>=2)?uint16CollectList[1]: 0; pixel.z = (uint16CollectList.size()>=3)?uint16CollectList[2]: 0; - // USER_PRINTF("led %d,%d,%d start %d,%d,%d end %d,%d,%d\n",x,y,z, startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z); + // ppf("led %d,%d,%d start %d,%d,%d end %d,%d,%d\n",x,y,z, startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z); stackUnsigned8 rowNr = 0; for (Leds *leds: projections) { @@ -116,14 +116,14 @@ void Fixture::projectAndMap() { proCenter /= proMulti; mirrors = pixelAdjusted / sizeAdjusted; //place the pixel in the right quadrant pixelAdjusted = pixelAdjusted%sizeAdjusted; // pixel % size - // USER_PRINTF("Multiply %d,%d,%d\n", leds->size.x, leds->size.y, leds->size.z); + // ppf("Multiply %d,%d,%d\n", leds->size.x, leds->size.y, leds->size.z); } bool mirror = mdl->getValue("mirror", rowNr); - // USER_PRINTF("projectionNr p:%d f:%d s:%d, %d-%d-%d %d-%d-%d %d-%d-%d\n", projectionNr, effectDimension, projectionDimension, x, y, z, uint16CollectList[0], uint16CollectList[1], uint16CollectList[2], size.x, size.y, size.z); + // ppf("projectionNr p:%d f:%d s:%d, %d-%d-%d %d-%d-%d %d-%d-%d\n", projectionNr, effectDimension, projectionDimension, x, y, z, uint16CollectList[0], uint16CollectList[1], uint16CollectList[2], size.x, size.y, size.z); if (leds->size == Coord3D{0,0,0}) { // first - USER_PRINTF("projectAndMap first leds[%d] size:%d,%d,%d s:%d,%d,%d e:%d,%d,%d\n", rowNr, sizeAdjusted.x, sizeAdjusted.y, sizeAdjusted.z, startPosAdjusted.x, startPosAdjusted.y, startPosAdjusted.z, endPosAdjusted.x, endPosAdjusted.y, endPosAdjusted.z); + ppf("projectAndMap first leds[%d] size:%d,%d,%d s:%d,%d,%d e:%d,%d,%d\n", rowNr, sizeAdjusted.x, sizeAdjusted.y, sizeAdjusted.z, startPosAdjusted.x, startPosAdjusted.y, startPosAdjusted.z, endPosAdjusted.x, endPosAdjusted.y, endPosAdjusted.z); } //calculate the indexV to add to current physical led to @@ -187,7 +187,7 @@ void Fixture::projectAndMap() { } mapped.z = 0; - // USER_PRINTF("2Dto2D %d-%d p:%d,%d,%d m:%d,%d,%d\n", indexV, indexP, pixelAdjusted.x, pixelAdjusted.y, pixelAdjusted.z, mapped.x, mapped.y, mapped.z + // ppf("2Dto2D %d-%d p:%d,%d,%d m:%d,%d,%d\n", indexV, indexP, pixelAdjusted.x, pixelAdjusted.y, pixelAdjusted.z, mapped.x, mapped.y, mapped.z break; case _3D: //2D3D if (leds->size == Coord3D{0,0,0}) { // first @@ -199,7 +199,7 @@ void Fixture::projectAndMap() { mapped.y = pixelAdjusted.y / 2 + pixelAdjusted.z; mapped.z = 0; - // USER_PRINTF("2D to 3D indexV %d %d\n", indexV, size.x); + // ppf("2D to 3D indexV %d %d\n", indexV, size.x); break; } @@ -249,7 +249,7 @@ void Fixture::projectAndMap() { if (indexV != UINT16_MAX) { if (indexV >= leds->nrOfLeds || indexV >= NUM_LEDS_Max) { - USER_PRINTF("dev pre [%d] indexV too high %d>=%d or %d (m:%d p:%d) p:%d,%d,%d s:%d,%d,%d\n", rowNr, indexV, leds->nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z, leds->size.x, leds->size.y, leds->size.z); + ppf("dev pre [%d] indexV too high %d>=%d or %d (m:%d p:%d) p:%d,%d,%d s:%d,%d,%d\n", rowNr, indexV, leds->nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z, leds->size.x, leds->size.y, leds->size.z); } else { Trigo trigo(leds->size.x-1); // 8 bits trigo with period leds->size.x-1 (currentl Float trigo as same performance) @@ -261,7 +261,7 @@ void Fixture::projectAndMap() { switch (projectionDimension) { case _2D: //2D2D: inverse mapping float minDistance = 10; - // USER_PRINTF("checking indexV %d\n", indexV); + // ppf("checking indexV %d\n", indexV); for (forUnsigned16 x=0; xsize.x && minDistance > 0.5f; x++) { // float xFactor = x * TWO_PI / (float)(leds->size.x-1); //between 0 .. 2PI @@ -276,7 +276,7 @@ void Fixture::projectAndMap() { float x2New = round((yFactor * xNew + leds->size.x) / 2.0f); // 0 .. size.x float y2New = round((yFactor * yNew + leds->size.y) / 2.0f); // 0 .. size.y - // USER_PRINTF(" %d,%d->%f,%f->%f,%f", x, y, sinf(x * TWO_PI / (float)(size.x-1)), cosf(x * TWO_PI / (float)(size.x-1)), xNew, yNew); + // ppf(" %d,%d->%f,%f->%f,%f", x, y, sinf(x * TWO_PI / (float)(size.x-1)), cosf(x * TWO_PI / (float)(size.x-1)), xNew, yNew); //this should work (better) but needs more testing // float distance = abs(indexV - xNew - yNew * size.x); @@ -287,10 +287,10 @@ void Fixture::projectAndMap() { // if the new XY i if (indexV == leds->XY(x2New, y2New)) { //(unsigned8)xNew + (unsigned8)yNew * size.x) { - // USER_PRINTF(" found one %d => %d=%d+%d*%d (%f+%f*%d) [%f]\n", indexV, x+y*size.x, x,y, size.x, xNew, yNew, size.x, distance); + // ppf(" found one %d => %d=%d+%d*%d (%f+%f*%d) [%f]\n", indexV, x+y*size.x, x,y, size.x, xNew, yNew, size.x, distance); indexV = leds->XY(x, y); - if (indexV%10 == 0) USER_PRINTF("."); //show some progress as this projection is slow (Need S007 to optimize ;-) + if (indexV%10 == 0) ppf("."); //show some progress as this projection is slow (Need S007 to optimize ;-) minDistance = 0.0f; // stop looking further } @@ -307,13 +307,13 @@ void Fixture::projectAndMap() { if (indexV != UINT16_MAX) { //can be nulled by inverse mapping //add physical tables if not present if (indexV >= leds->nrOfLeds || indexV >= NUM_LEDS_Max) { - USER_PRINTF("dev post [%d] indexV too high %d>=%d or %d (p:%d m:%d) p:%d,%d,%d\n", rowNr, indexV, leds->nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z); + ppf("dev post [%d] indexV too high %d>=%d or %d (p:%d m:%d) p:%d,%d,%d\n", rowNr, indexV, leds->nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z); } else if (indexP < NUM_LEDS_Max) { //create new physMaps if needed if (indexV >= leds->mappingTable.size()) { for (size_t i = leds->mappingTable.size(); i <= indexV; i++) { - // USER_PRINTF("mapping %d,%d,%d add physMap before %d %d\n", pixel.y, pixel.y, pixel.z, indexV, leds->mappingTable.size()); + // ppf("mapping %d,%d,%d add physMap before %d %d\n", pixel.y, pixel.y, pixel.z, indexV, leds->mappingTable.size()); leds->mappingTable.push_back(PhysMap()); //abort() was called at PC 0x40191473 on core 1 std::allocator >&&) } } @@ -324,9 +324,9 @@ void Fixture::projectAndMap() { leds->mappingTable[indexV].indexes->push_back(indexP); //add the current led to indexes } else - USER_PRINTF("dev post [%d] indexP too high %d>=%d or %d (p:%d m:%d) p:%d,%d,%d\n", rowNr, indexP, nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z); + ppf("dev post [%d] indexP too high %d>=%d or %d (p:%d m:%d) p:%d,%d,%d\n", rowNr, indexP, nrOfLeds, NUM_LEDS_Max, leds->mappingTable.size(), indexP, pixel.x, pixel.y, pixel.z); } - // USER_PRINTF("mapping b:%d t:%d V:%d\n", indexV, indexP, leds->mappingTable.size()); + // ppf("mapping b:%d t:%d V:%d\n", indexV, indexP, leds->mappingTable.size()); } //indexV not too high } //indexV @@ -352,7 +352,7 @@ void Fixture::projectAndMap() { stackUnsigned16 startLed = atoi(before); stackUnsigned16 nrOfLeds = atoi(after) - atoi(before) + 1; print->fFormat(details, sizeof(details)-1, "%d-%d", min(prevIndexP, startLed), max((stackUnsigned16)(indexP - 1), nrOfLeds)); //careful: LedModEffects:loop uses this to assign to FastLed - USER_PRINTF("pins extend leds %d: %s\n", currPin, details); + ppf("pins extend leds %d: %s\n", currPin, details); //tbd: more check strncpy(pins->pinObjects[currPin].details, details, sizeof(PinObject::details)-1); @@ -362,7 +362,7 @@ void Fixture::projectAndMap() { else {//allocate new pin //tbd: check if free print->fFormat(details, sizeof(details)-1, "%d-%d", prevIndexP, indexP - 1); //careful: LedModEffects:loop uses this to assign to FastLed - // USER_PRINTF("allocatePin %d: %s\n", currPin, details); + // ppf("allocatePin %d: %s\n", currPin, details); pins->allocatePin(currPin, "Leds", details); } @@ -378,7 +378,7 @@ void Fixture::projectAndMap() { for (Leds *leds: projections) { if (leds->doMap) { - USER_PRINTF("projectAndMap post leds[%d] fx:%d pro:%d\n", rowNr, leds->fx, leds->projectionNr); + ppf("projectAndMap post leds[%d] fx:%d pro:%d\n", rowNr, leds->fx, leds->projectionNr); stackUnsigned16 nrOfMappings = 0; stackUnsigned16 nrOfPixels = 0; @@ -392,7 +392,7 @@ void Fixture::projectAndMap() { } else { // if (leds->mappingTable.size() < leds->size.x * leds->size.y * leds->size.z) - // USER_PRINTF("mapping add extra physMap %d to %d size: %d,%d,%d\n", leds->mappingTable.size(), leds->size.x * leds->size.y * leds->size.z, leds->size.x, leds->size.y, leds->size.z); + // ppf("mapping add extra physMap %d to %d size: %d,%d,%d\n", leds->mappingTable.size(), leds->size.x * leds->size.y * leds->size.z, leds->size.x, leds->size.y, leds->size.z); // for (size_t i = leds->mappingTable.size(); i < leds->size.x * leds->size.y * leds->size.z; i++) { // std::vector physMap; // // physMap.push_back(0); @@ -407,27 +407,27 @@ void Fixture::projectAndMap() { if (map.indexes && map.indexes->size()) { // if (nrOfMappings < 10 || map.indexes->size() - indexV < 10) //first 10 and last 10 // if (nrOfMappings%(leds->nrOfLeds/10+1) == 0) - // USER_PRINTF("ledV %d mapping: #ledsP (%d):", indexV, nrOfMappings, map.indexes->size()); + // ppf("ledV %d mapping: #ledsP (%d):", indexV, nrOfMappings, map.indexes->size()); for (forUnsigned16 indexP:*map.indexes) { // if (nrOfPixels < 10 || map.indexes->size() - indexV < 10) // if (nrOfMappings%(leds->nrOfLeds/10+1) == 0) - // USER_PRINTF(" %d", indexP); + // ppf(" %d", indexP); nrOfPixels++; } // if (nrOfPixels < 10 || map.indexes->size() - indexV < 10) // if (nrOfMappings%(leds->nrOfLeds/10+1) == 0) - // USER_PRINTF("\n"); + // ppf("\n"); } nrOfMappings++; // else - // USER_PRINTF("ledV %d no mapping\n", x); + // ppf("ledV %d no mapping\n", x); indexV++; } } - USER_PRINTF("projectAndMap leds[%d] V:%d x %d x %d -> %d (v:%d - p:%d)\n", rowNr, leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds, nrOfMappings, nrOfPixels); + ppf("projectAndMap leds[%d] V:%d x %d x %d -> %d (v:%d - p:%d)\n", rowNr, leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds, nrOfMappings, nrOfPixels); // mdl->setValueV("fxSize", rowNr, "%d x %d x %d = %d", leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds); char buf[32]; @@ -435,14 +435,14 @@ void Fixture::projectAndMap() { mdl->setValue("fxSize", JsonString(buf, JsonString::Copied), rowNr); // web->sendResponseObject(); - USER_PRINTF("leds[%d].size = %d + %d\n", rowNr, sizeof(Leds), leds->mappingTable.size()); //44 + ppf("leds[%d].size = %d + %d\n", rowNr, sizeof(Leds), leds->mappingTable.size()); //44 leds->doMap = false; } //leds->doMap rowNr++; } // leds - USER_PRINTF("projectAndMap fixture P:%dx%dx%d -> %d\n", size.x, size.y, size.z, nrOfLeds); + ppf("projectAndMap fixture P:%dx%dx%d -> %d\n", size.x, size.y, size.z, nrOfLeds); mdl->setValue("fixSize", size); mdl->setValue("fixCount", nrOfLeds); @@ -450,7 +450,7 @@ void Fixture::projectAndMap() { } // if deserialize } //if fileName else - USER_PRINTF("projectAndMap: Filename for fixture %d not found\n", fixtureNr); + ppf("projectAndMap: Filename for fixture %d not found\n", fixtureNr); doMap = false; } \ No newline at end of file diff --git a/src/App/LedLeds.cpp b/src/App/LedLeds.cpp index 32390c3f..d46f26d0 100644 --- a/src/App/LedLeds.cpp +++ b/src/App/LedLeds.cpp @@ -53,7 +53,7 @@ void Leds::setPixelColor(unsigned16 indexV, CRGB color, unsigned8 blendAmount) { else if (indexV < NUM_LEDS_Max) //no projection fixture->ledsP[projectionNr==p_Random?random(fixture->nrOfLeds):indexV] = color; else if (indexV != UINT16_MAX) //assuming UINT16_MAX is set explicitly (e.g. in XYZ) - USER_PRINTF(" dev sPC V:%d >= %d", indexV, NUM_LEDS_Max); + ppf(" dev sPC V:%d >= %d", indexV, NUM_LEDS_Max); } CRGB Leds::getPixelColor(unsigned16 indexV) { @@ -66,7 +66,7 @@ CRGB Leds::getPixelColor(unsigned16 indexV) { else if (indexV < NUM_LEDS_Max) //no mapping return fixture->ledsP[indexV]; else { - USER_PRINTF(" dev gPC N: %d >= %d", indexV, NUM_LEDS_Max); + ppf(" dev gPC N: %d >= %d", indexV, NUM_LEDS_Max); return CRGB::Black; } } diff --git a/src/App/LedLeds.h b/src/App/LedLeds.h index b6ff412b..b4db492b 100644 --- a/src/App/LedLeds.h +++ b/src/App/LedLeds.h @@ -126,10 +126,10 @@ class SharedData { public: SharedData() { - // USER_PRINTF("SharedData constructor %d %d\n", index, bytesAllocated); + // ppf("SharedData constructor %d %d\n", index, bytesAllocated); } ~SharedData() { - // USER_PRINTF("SharedData destructor WIP %d %d\n", index, bytesAllocated); + // ppf("SharedData destructor WIP %d %d\n", index, bytesAllocated); // free(data); } @@ -147,14 +147,14 @@ class SharedData { size_t newIndex = index + length * sizeof(Type); if (newIndex > bytesAllocated) { size_t newSize = bytesAllocated + (1 + ( newIndex - bytesAllocated)/1024) * 1024; // add a multitude of 1024 bytes - USER_PRINTF("bind add more %d->%d %d->%d\n", index, newIndex, bytesAllocated, newSize); + ppf("bind add more %d->%d %d->%d\n", index, newIndex, bytesAllocated, newSize); if (bytesAllocated == 0) data = (byte*) malloc(newSize); else data = (byte*)realloc(data, newSize); bytesAllocated = newSize; } - // USER_PRINTF("bind %d->%d %d\n", index, newIndex, bytesAllocated); + // ppf("bind %d->%d %d\n", index, newIndex, bytesAllocated); returnValue = reinterpret_cast(data + index); index = newIndex; //add consumed amount of bytes, index is next byte which will be pointed to return returnValue; @@ -212,12 +212,12 @@ class Leds { unsigned16 XYZ(unsigned16 x, unsigned16 y, unsigned16 z); Leds(Fixture &fixture) { - USER_PRINTF("Leds constructor (PhysMap:%d)\n", sizeof(PhysMap)); + ppf("Leds constructor (PhysMap:%d)\n", sizeof(PhysMap)); this->fixture = &fixture; } ~Leds() { - USER_PRINTF("Leds destructor\n"); + ppf("Leds destructor\n"); fadeToBlackBy(100); doMap = true; // so loop is not running while deleting for (PhysMap &map:mappingTable) { diff --git a/src/App/LedModEffects.h b/src/App/LedModEffects.h index 9354d7d4..94d91656 100644 --- a/src/App/LedModEffects.h +++ b/src/App/LedModEffects.h @@ -56,7 +56,7 @@ class LedModEffects:public SysModule { return true; case f_AddRow: { rowNr = fixture.projections.size(); - // USER_PRINTF("chFun addRow %s[%d]\n", mdl->varID(var), rowNr); + // ppf("chFun addRow %s[%d]\n", mdl->varID(var), rowNr); web->getResponseObject()["addRow"]["rowNr"] = rowNr; @@ -64,7 +64,7 @@ class LedModEffects:public SysModule { fixture.projections.push_back(new Leds(fixture)); return true; } case f_DelRow: { - // USER_PRINTF("chFun delrow %s[%d]\n", mdl->varID(var), rowNr); + // ppf("chFun delrow %s[%d]\n", mdl->varID(var), rowNr); //tbd: fade to black if (rowNr = fixture.projections.size()) { - USER_PRINTF("projections fx[%d] changeFun %d %s\n", rowNr, fixture.projections.size(), mdl->findVar("fx")["value"].as().c_str()); + ppf("projections fx[%d] changeFun %d %s\n", rowNr, fixture.projections.size(), mdl->findVar("fx")["value"].as().c_str()); fixture.projections.push_back(new Leds(fixture)); } if (rowNr < fixture.projections.size()) @@ -148,7 +148,7 @@ class LedModEffects:public SysModule { return true; case f_ChangeFun: //initiate projectAndMap - USER_PRINTF("proCenter %d %d\n", rowNr, fixture.projections.size()); + ppf("proCenter %d %d\n", rowNr, fixture.projections.size()); if (rowNr < fixture.projections.size()) { fixture.projections[rowNr]->doMap = true; //Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled. fixture.doMap = true; @@ -211,7 +211,7 @@ class LedModEffects:public SysModule { } mdl->varPostDetails(var, rowNr); - // USER_PRINTF("chFun pro[%d] <- %d (%d)\n", rowNr, proValue, fixture.projections.size()); + // ppf("chFun pro[%d] <- %d (%d)\n", rowNr, proValue, fixture.projections.size()); fixture.doMap = true; } @@ -223,7 +223,7 @@ class LedModEffects:public SysModule { ui->initCoord3D(tableVar, "fxStart", {0,0,0}, 0, NUM_LEDS_Max, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun case f_ValueFun: for (forUnsigned8 rowNr = 0; rowNr < fixture.projections.size(); rowNr++) { - USER_PRINTF("fxStart[%d] valueFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->startPos.x, fixture.projections[rowNr]->startPos.y, fixture.projections[rowNr]->startPos.z); + ppf("fxStart[%d] valueFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->startPos.x, fixture.projections[rowNr]->startPos.y, fixture.projections[rowNr]->startPos.z); mdl->setValue(var, fixture.projections[rowNr]->startPos, rowNr); } return true; @@ -235,14 +235,14 @@ class LedModEffects:public SysModule { if (rowNr < fixture.projections.size()) { fixture.projections[rowNr]->startPos = mdl->getValue(var, rowNr).as(); - USER_PRINTF("fxStart[%d] chFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->startPos.x, fixture.projections[rowNr]->startPos.y, fixture.projections[rowNr]->startPos.z); + ppf("fxStart[%d] chFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->startPos.x, fixture.projections[rowNr]->startPos.y, fixture.projections[rowNr]->startPos.z); fixture.projections[rowNr]->fadeToBlackBy(); fixture.projections[rowNr]->doMap = true; fixture.doMap = true; } else { - USER_PRINTF("fxStart[%d] chfun rownr not in range > %d\n", rowNr, fixture.projections.size()); + ppf("fxStart[%d] chfun rownr not in range > %d\n", rowNr, fixture.projections.size()); } return true; default: return false; @@ -251,7 +251,7 @@ class LedModEffects:public SysModule { ui->initCoord3D(tableVar, "fxEnd", {8,8,0}, 0, NUM_LEDS_Max, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun case f_ValueFun: for (forUnsigned8 rowNr = 0; rowNr < fixture.projections.size(); rowNr++) { - USER_PRINTF("fxEnd[%d] valueFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->endPos.x, fixture.projections[rowNr]->endPos.y, fixture.projections[rowNr]->endPos.z); + ppf("fxEnd[%d] valueFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->endPos.x, fixture.projections[rowNr]->endPos.y, fixture.projections[rowNr]->endPos.z); mdl->setValue(var, fixture.projections[rowNr]->endPos, rowNr); } return true; @@ -263,14 +263,14 @@ class LedModEffects:public SysModule { if (rowNr < fixture.projections.size()) { fixture.projections[rowNr]->endPos = mdl->getValue(var, rowNr).as(); - USER_PRINTF("fxEnd[%d] chFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->endPos.x, fixture.projections[rowNr]->endPos.y, fixture.projections[rowNr]->endPos.z); + ppf("fxEnd[%d] chFun %d,%d,%d\n", rowNr, fixture.projections[rowNr]->endPos.x, fixture.projections[rowNr]->endPos.y, fixture.projections[rowNr]->endPos.z); fixture.projections[rowNr]->fadeToBlackBy(); fixture.projections[rowNr]->doMap = true; fixture.doMap = true; } else { - USER_PRINTF("fxEnd[%d] chfun rownr not in range > %d\n", rowNr, fixture.projections.size()); + ppf("fxEnd[%d] chfun rownr not in range > %d\n", rowNr, fixture.projections.size()); } return true; default: return false; @@ -283,7 +283,7 @@ class LedModEffects:public SysModule { for (Leds *leds:fixture.projections) { char message[32]; print->fFormat(message, sizeof(message)-1, "%d x %d x %d -> %d", leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds); - USER_PRINTF("valueFun fxSize[%d] = %s\n", rowNr, message); + ppf("valueFun fxSize[%d] = %s\n", rowNr, message); mdl->setValue(var, JsonString(message, JsonString::Copied), rowNr); //rowNr rowNr++; } @@ -331,7 +331,7 @@ class LedModEffects:public SysModule { // } // else - // USER_PRINTF("Leds e131 not enabled\n"); + // ppf("Leds e131 not enabled\n"); #endif effects.setup(); @@ -353,7 +353,7 @@ class LedModEffects:public SysModule { stackUnsigned8 rowNr = 0; for (Leds *leds: fixture.projections) { if (!leds->doMap) { // don't run effect while remapping - // USER_PRINTF(" %d %d,%d,%d - %d,%d,%d (%d,%d,%d)", leds->fx, leds->startPos.x, leds->startPos.y, leds->startPos.z, leds->endPos.x, leds->endPos.y, leds->endPos.z, leds->size.x, leds->size.y, leds->size.z ); + // ppf(" %d %d,%d,%d - %d,%d,%d (%d,%d,%d)", leds->fx, leds->startPos.x, leds->startPos.y, leds->startPos.z, leds->endPos.x, leds->endPos.y, leds->endPos.z, leds->size.x, leds->size.y, leds->size.z ); mdl->getValueRowNr = rowNr++; effects.loop(*leds); mdl->getValueRowNr = UINT8_MAX; @@ -384,7 +384,7 @@ class LedModEffects:public SysModule { JsonObject var = mdl->findVar("System"); if (!var["canvasData"].isNull()) { const char * canvasData = var["canvasData"]; //0 - 494 - 140,150,0 - USER_PRINTF("LedModEffects loop canvasData %s\n", canvasData); + ppf("LedModEffects loop canvasData %s\n", canvasData); uint8_t rowNr = 0; //currently only leds[0] supported if (fixture.projections.size()) { @@ -442,7 +442,7 @@ class LedModEffects:public SysModule { stackUnsigned16 startLed = atoi(before); stackUnsigned16 nrOfLeds = atoi(after) - atoi(before) + 1; - USER_PRINTF("FastLED.addLeds new %d: %d-%d\n", pinNr, startLed, nrOfLeds-1); + ppf("FastLED.addLeds new %d: %d-%d\n", pinNr, startLed, nrOfLeds-1); //commented pins: error: static assertion failed: Invalid pin specified switch (pinNr) { @@ -641,7 +641,7 @@ class LedModEffects:public SysModule { case 48: FastLED.addLeds(fixture.ledsP, startLed, nrOfLeds).setCorrection(TypicalLEDStrip); break; #endif //CONFIG_IDF_TARGET_ESP32S3 - default: USER_PRINTF("FastLedPin assignment: pin not supported %d\n", pinNr); + default: ppf("FastLedPin assignment: pin not supported %d\n", pinNr); } //switch pinNr } //if led range in details (- in details e.g. 0-1023) } //if pin owned by leds @@ -658,7 +658,7 @@ class LedModEffects:public SysModule { } void loop10s() { - // USER_PRINTF("caching %u %u\n", trigoCached, trigoUnCached); //not working for some reason!! + // ppf("caching %u %u\n", trigoCached, trigoUnCached); //not working for some reason!! // trigoCached = 0; // trigoUnCached = 0; } diff --git a/src/App/LedModFixture.h b/src/App/LedModFixture.h index 2079ebe3..f53832c8 100644 --- a/src/App/LedModFixture.h +++ b/src/App/LedModFixture.h @@ -45,7 +45,7 @@ class LedModFixture:public SysModule { FastLED.setBrightness(result); - USER_PRINTF("Set Brightness to %d -> b:%d r:%d\n", var["value"].as(), bri, result); + ppf("Set Brightness to %d -> b:%d r:%d\n", var["value"].as(), bri, result); return true; } default: return false; }}); diff --git a/src/App/LedModFixtureGen.h b/src/App/LedModFixtureGen.h index 39b4961c..67df46b5 100644 --- a/src/App/LedModFixtureGen.h +++ b/src/App/LedModFixtureGen.h @@ -36,11 +36,11 @@ class GenFix { File f; GenFix() { - USER_PRINTF("GenFix constructor\n"); + ppf("GenFix constructor\n"); } ~GenFix() { - USER_PRINTF("GenFix destructor\n"); + ppf("GenFix destructor\n"); } void openHeader(const char * format, ...) { @@ -53,7 +53,7 @@ class GenFix { f = files->open("/temp.json", "w"); if (!f) - USER_PRINTF("GenFix could not open temp file for writing\n"); + ppf("GenFix could not open temp file for writing\n"); f.print(",\"outputs\":["); strcpy(pinSep, ""); @@ -62,7 +62,7 @@ class GenFix { void closeHeader() { f.print("]"); //outputs - USER_PRINTF("closeHeader %d-%d-%d %d\n", fixSize.x, fixSize.y, fixSize.z, nrOfLeds); + ppf("closeHeader %d-%d-%d %d\n", fixSize.x, fixSize.y, fixSize.z, nrOfLeds); f.close(); f = files->open("/temp.json", "r"); @@ -114,7 +114,7 @@ class GenFix { void write3D(unsigned16 x, unsigned16 y, unsigned16 z) { // if (x>UINT16_MAX/2 || y>UINT16_MAX/2 || z>UINT16_MAX/2) if (x>1000 || y>1000 || z>1000) - USER_PRINTF("write3D coord too high %d,%d,%d\n", x, y, z); + ppf("write3D coord too high %d,%d,%d\n", x, y, z); else { f.printf("%s[%d,%d,%d]", pixelSep, x, y, z); @@ -188,14 +188,14 @@ class GenFix { Coord3D rowPixel = cRowStart; while (true) { - USER_PRINTF(" %d,%d,%d", rowPixel.x, rowPixel.y, rowPixel.z); + ppf(" %d,%d,%d", rowPixel.x, rowPixel.y, rowPixel.z); write3D(rowPixel.x*10, rowPixel.y*10, rowPixel.z*10); if (rowPixel == cRowEnd) break; //end condition row rowPixel.advance(cRowEnd); } - USER_PRINTF("\n"); + ppf("\n"); if (colPixel == colEnd) break; //end condition columns colPixel.advance(colEnd); @@ -316,7 +316,7 @@ class GenFix { // Use interpolation to get coordinates of that point on that edge float x = (float)middle.x + radius*10.0f * (hexaX[edgenum] + offset * (hexaX[edgenum + 1] - hexaX[edgenum])); float y = (float)middle.y + radius*10.0f * (hexaY[edgenum] + offset * (hexaY[edgenum + 1] - hexaY[edgenum])); - // USER_PRINTF(" %d %f: %f,%f", edgenum, offset, x, y); + // ppf(" %d %f: %f,%f", edgenum, offset, x, y); write3D(x, y, first.z*10); @@ -337,7 +337,7 @@ class GenFix { stackUnsigned8 ringNrOfLeds = (j+1) * 3; middle.y = first.y*10 + j*10; - USER_PRINTF("Cone %d %d %d %d,%d,%d\n", j, nrOfRings, ringNrOfLeds, middle.x, middle.y, middle.z); + ppf("Cone %d %d %d %d,%d,%d\n", j, nrOfRings, ringNrOfLeds, middle.x, middle.y, middle.z); ring(middle, ringNrOfLeds, ip, pin, 0, 90, 0); //tilt 90 } @@ -397,7 +397,7 @@ class GenFix { // Coord3D start = first; // start.y = first.y + lat; - USER_PRINTF("Globe %d %f %d %d,%d,%d\n", lat, ringDiam, ledCount, middle.x, middle.y, middle.z); + ppf("Globe %d %f %d %d,%d,%d\n", lat, ringDiam, ledCount, middle.x, middle.y, middle.z); ring(middle, ledCount, ip, pin, 0, 90, 0); //tilt 90 } } @@ -1034,7 +1034,7 @@ class LedModFixtureGen:public SysModule { // File f = files->open(fileName, "w"); // if (!f) - // USER_PRINTF("fixtureGen Could not open file %s for writing\n", fileName); + // ppf("fixtureGen Could not open file %s for writing\n", fileName); // return f; // } diff --git a/src/User/UserModArtNet.h b/src/User/UserModArtNet.h index 3e026a95..c3e108a2 100644 --- a/src/User/UserModArtNet.h +++ b/src/User/UserModArtNet.h @@ -56,7 +56,7 @@ class UserModArtNet:public SysModule { size_t ddpInst = var["value"]; if (ddpInst >=0 && ddpInst < instances->instances.size()) { targetIp = instances->instances[ddpInst].ip; - USER_PRINTF("Start ArtNet to %s\n", targetIp.toString().c_str()); + ppf("Start ArtNet to %s\n", targetIp.toString().c_str()); } return true; } @@ -94,7 +94,7 @@ class UserModArtNet:public SysModule { if (sequenceNumber > 255) sequenceNumber = 0; if (!ddpUdp.beginPacket(targetIp, ARTNET_DEFAULT_PORT)) { - USER_PRINTF("Art-Net WiFiUDP.beginPacket returned an error\n"); + ppf("Art-Net WiFiUDP.beginPacket returned an error\n"); return; // borked } @@ -126,7 +126,7 @@ class UserModArtNet:public SysModule { } if (!ddpUdp.endPacket()) { - USER_PRINTF("Art-Net WiFiUDP.endPacket returned an error\n"); + ppf("Art-Net WiFiUDP.endPacket returned an error\n"); return; // borked } channel += packetSize; diff --git a/src/User/UserModDDP.h b/src/User/UserModDDP.h index ef8d6cab..8bfa01f0 100644 --- a/src/User/UserModDDP.h +++ b/src/User/UserModDDP.h @@ -73,7 +73,7 @@ class UserModDDP:public SysModule { size_t ddpInst = var["value"]; if (ddpInst >=0 && ddpInst < instances->instances.size()) { targetIp = instances->instances[ddpInst].ip; - USER_PRINTF("Start DDP to %s\n", targetIp.toString().c_str()); + ppf("Start DDP to %s\n", targetIp.toString().c_str()); } return true; } @@ -110,7 +110,7 @@ class UserModDDP:public SysModule { if (sequenceNumber > 15) sequenceNumber = 0; if (!ddpUdp.beginPacket(targetIp, DDP_DEFAULT_PORT)) { // port defined in ESPAsyncE131.h - USER_PRINTF("DDP WiFiUDP.beginPacket returned an error\n"); + ppf("DDP WiFiUDP.beginPacket returned an error\n"); return; // borked } @@ -150,7 +150,7 @@ class UserModDDP:public SysModule { } if (!ddpUdp.endPacket()) { - USER_PRINTF("DDP WiFiUDP.endPacket returned an error\n"); + ppf("DDP WiFiUDP.endPacket returned an error\n"); return; // problem } channel += packetSize; diff --git a/src/User/UserModWLEDAudio.h b/src/User/UserModWLEDAudio.h index 2b436947..7c8b3ca1 100644 --- a/src/User/UserModWLEDAudio.h +++ b/src/User/UserModWLEDAudio.h @@ -62,14 +62,14 @@ class UserModWLEDAudio:public SysModule { // SysModule::loop(); if (mdls->isConnected && sync.read()) { lastData = millis(); - if(debug) USER_PRINTF("WLED-Sync: "); + if(debug) ppf("WLED-Sync: "); for (int b = 0; b < NUM_GEQ_CHANNELS; b++) { byte val = sync.fftResult[b]; fftResults[b] = val; - if(debug) USER_PRINTF("%u ", val); + if(debug) ppf("%u ", val); } volumeSmth = sync.volumeSmth; - if(debug) USER_PRINTF("\n"); + if(debug) ppf("\n"); } else if((lastData == 0) || isTimeout()) { // Could also check for non-silent simulateSound(UMS_BeatSin); @@ -77,7 +77,7 @@ class UserModWLEDAudio:public SysModule { } void loop10s() { - // USER_PRINTF("%d, %s, %d\n", sync.receivedFormat, sync.sourceIP.toString().c_str(), sync.lastPacketTime); + // ppf("%d, %s, %d\n", sync.receivedFormat, sync.sourceIP.toString().c_str(), sync.lastPacketTime); String msg = ""; if((lastData != 0) && isTimeout()) { msg = sync.sourceIP.toString() + " Timeout " + ((millis() - lastData) / 1000) +"s";