MCPcopy Create free account
hub / github.com/FastLED/FastLED / CSmartMatrixController

Class CSmartMatrixController

src/platforms/arm/k20/smartmatrix_t3.h:15–51  ·  view source on GitHub ↗

note - dmx simple must be included before FastSPI for this code to be enabled

Source from the content-addressed store, hash-verified

13
14// note - dmx simple must be included before FastSPI for this code to be enabled
15class CSmartMatrixController : public CPixelLEDController<RGB_ORDER> {
16 SmartMatrix matrix;
17
18public:
19 // initialize the LED controller
20 virtual void init() FL_NOEXCEPT {
21 // Initialize 32x32 LED Matrix
22 matrix.begin();
23 matrix.setBrightness(255);
24 matrix.setColorCorrection(ccNone);
25
26 // Clear screen
27 clearLeds(0);
28 matrix.swapBuffers();
29 pSmartMatrix = &matrix;
30 }
31
32 virtual void showPixels(PixelController<RGB_ORDER> & pixels) FL_NOEXCEPT {
33 if(SMART_MATRIX_CAN_TRIPLE_BUFFER) {
34 rgb24 *md = matrix.getRealBackBuffer();
35 } else {
36 rgb24 *md = matrix.backBuffer();
37 }
38 while(pixels.has(1)) {
39 md->red = pixels.loadAndScale0();
40 md->green = pixels.loadAndScale1();
41 md->blue = pixels.loadAndScale2();
42 md++;
43 pixels.advanceData();
44 pixels.stepDithering();
45 }
46 matrix.swapBuffers();
47 if(SMART_MATRIX_CAN_TRIPLE_BUFFER && pixels.advanceBy() > 0) {
48 matrix.setBackBuffer(pixels.mData);
49 }
50 }
51};
52} // namespace fl
53#endif
54

Callers

nothing calls this directly

Calls 3

clearLedsFunction · 0.50
beginMethod · 0.45
setBrightnessMethod · 0.45

Tested by

no test coverage detected