FastLED 3.9.15
Loading...
Searching...
No Matches

◆ processCodecWithTiming()

void CodecProcessor::processCodecWithTiming ( const char * codecName,
fl::function< void()> codecFunc )

Definition at line 18 of file codec_processor.cpp.

18 {
19 FL_WARN("Starting format " << codecName);
20
21 fl::u32 start_time = millis();
22
23 // Execute the codec processing function
24 codecFunc();
25
26 fl::u32 diff_time = millis() - start_time;
27
28 FL_WARN("Format took " << diff_time << "ms to process " << codecName);
29
30 // Now build up the message to display the current leds
31 fl::sstream message;
32 message << "Format: " << codecName << "\n";
33 message << "LEDs: " << numLeds << " (" << ledWidth << "x" << ledHeight << ")\n";
34
35 // For 32x32, just show a summary rather than all pixels
36 if (numLeds > 16) {
37 // Show first few pixels as a sample
38 message << "First 4 pixels: ";
39 for (int i = 0; i < 4 && i < numLeds; i++) {
40 message << "RGB(" << (int)leds[i].r << "," << (int)leds[i].g << "," << (int)leds[i].b << ") ";
41 }
42 message << "\n";
43 } else {
44 // For small displays, show all LEDs
45 for (int i = 0; i < numLeds; i++) {
46 message << "LED " << i << ": " << leds[i] << "\n";
47 }
48 }
49 FL_WARN(message.str().c_str());
50 FastLED.show();
51}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
void show(fl::u8 scale)
Update all our controllers with the current led colors, using the passed in brightness.
const char * c_str() const FL_NOEXCEPT
string str() const FL_NOEXCEPT
Definition strstream.h:43
#define FL_WARN(X)
Definition log.h:276

References fl::basic_string::c_str(), FastLED, FL_WARN, ledHeight, leds, ledWidth, numLeds, and fl::sstream::str().

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: