note - dmx simple must be included before FastSPI for this code to be enabled
| 13 | |
| 14 | // note - dmx simple must be included before FastSPI for this code to be enabled |
| 15 | class CSmartMatrixController : public CPixelLEDController<RGB_ORDER> { |
| 16 | SmartMatrix matrix; |
| 17 | |
| 18 | public: |
| 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 |
nothing calls this directly
no test coverage detected