Permalink
Browse files

show() callback can be a simple memcpy.

  • Loading branch information...
marcmerlin committed Jan 20, 2019
1 parent 2e83cc6 commit edcaf23c3960895cc8d81307335cf1da4cfd5c0a
Showing with 1 addition and 9 deletions.
  1. +1 −9 config.h
@@ -106,15 +106,7 @@ CRGB matrixleds[NUMMATRIX];

// Sadly this callback function must be copied around with this init code
void show_callback() {
for (uint16_t y=0; y<kMatrixHeight; y++) {
for (uint16_t x=0; x<kMatrixWidth; x++) {
CRGB led = matrixleds[x + kMatrixWidth*y];
// rgb24 defined in MatrixComnon.h
backgroundLayer.drawPixel(x, y, { led.r, led.g, led.b } );
}
}
// This should be zero copy
// that said, copy or no copy is about the same speed in the end.
memcpy(backgroundLayer.backBuffer(), matrixleds, kMatrixHeight*kMatrixWidth*3);
backgroundLayer.swapBuffers(false);
}

0 comments on commit edcaf23

Please sign in to comment.