Skip to content
Permalink
Browse files

Added support for 64-row /32 scan with SmartMatrix Shield V4

  • Loading branch information...
Louis Beaudoin
Louis Beaudoin committed Feb 17, 2018
1 parent c7fb410 commit 43dea743b645f9184a302ab10e51cad346391dd1
Showing with 21 additions and 5 deletions.
  1. +9 −5 src/SmartMatrix3.h
  2. +12 −0 src/SmartMatrix_Impl.h
@@ -129,17 +129,21 @@ class SmartMatrix3 {
static SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>* globalinstance;
};

#define SMARTMATRIX_HUB75_32ROW_MOD16SCAN 0
#define SMARTMATRIX_HUB75_16ROW_MOD8SCAN 1
#define SMARTMATRIX_HUB75_32ROW_MOD16SCAN 0
#define SMARTMATRIX_HUB75_16ROW_MOD8SCAN 1
#define SMARTMATRIX_HUB75_64ROW_MOD32SCAN 2

#define CONVERT_PANELTYPE_TO_MATRIXPANELHEIGHT(x) ((x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 32 : 0) | \
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 16 : 0))
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 16 : 0) | \
(x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 64 : 0))

#define CONVERT_PANELTYPE_TO_MATRIXROWPAIROFFSET(x) ((x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 16 : 0) | \
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0))
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0) | \
(x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 32 : 0))

#define CONVERT_PANELTYPE_TO_MATRIXROWSPERFRAME(x) ((x == SMARTMATRIX_HUB75_32ROW_MOD16SCAN ? 16 : 0) | \
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0))
(x == SMARTMATRIX_HUB75_16ROW_MOD8SCAN ? 8 : 0) | \
(x == SMARTMATRIX_HUB75_64ROW_MOD32SCAN ? 32 : 0))

#define SMARTMATRIX_OPTIONS_NONE 0
#define SMARTMATRIX_OPTIONS_C_SHAPE_STACKING (1 << 0)
@@ -957,21 +957,25 @@ INLINE void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, opt
o0.p0g1 = (currentRow & 0x02) ? 1 : 0;
o0.p0b1 = (currentRow & 0x04) ? 1 : 0;
o0.p0r2 = (currentRow & 0x08) ? 1 : 0;
o0.p0g2 = (currentRow & 0x10) ? 1 : 0;

o0.p1r1 = (currentRow & 0x01) ? 1 : 0;
o0.p1g1 = (currentRow & 0x02) ? 1 : 0;
o0.p1b1 = (currentRow & 0x04) ? 1 : 0;
o0.p1r2 = (currentRow & 0x08) ? 1 : 0;
o0.p1g2 = (currentRow & 0x10) ? 1 : 0;

o0.p2r1 = (currentRow & 0x01) ? 1 : 0;
o0.p2g1 = (currentRow & 0x02) ? 1 : 0;
o0.p2b1 = (currentRow & 0x04) ? 1 : 0;
o0.p2r2 = (currentRow & 0x08) ? 1 : 0;
o0.p2g2 = (currentRow & 0x10) ? 1 : 0;

o0.p3r1 = (currentRow & 0x01) ? 1 : 0;
o0.p3g1 = (currentRow & 0x02) ? 1 : 0;
o0.p3b1 = (currentRow & 0x04) ? 1 : 0;
o0.p3r2 = (currentRow & 0x08) ? 1 : 0;
o0.p3g2 = (currentRow & 0x10) ? 1 : 0;

// set pointer to the byte past the end of the pixel data to shift, and write the currentRow address
uint32_t * tempptr2 = (uint32_t*)matrixUpdateData + ((freeRowBuffer*dmaBufferBytesPerRow)/sizeof(uint32_t)) + (((PIXELS_PER_LATCH)*dmaBufferBytesPerPixel)/sizeof(uint32_t));
@@ -1316,21 +1320,25 @@ INLINE void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, opt
o0.p0g1 = (currentRow & 0x02) ? 1 : 0;
o0.p0b1 = (currentRow & 0x04) ? 1 : 0;
o0.p0r2 = (currentRow & 0x08) ? 1 : 0;
o0.p0g2 = (currentRow & 0x10) ? 1 : 0;

o0.p1r1 = (currentRow & 0x01) ? 1 : 0;
o0.p1g1 = (currentRow & 0x02) ? 1 : 0;
o0.p1b1 = (currentRow & 0x04) ? 1 : 0;
o0.p1r2 = (currentRow & 0x08) ? 1 : 0;
o0.p1g2 = (currentRow & 0x10) ? 1 : 0;

o0.p2r1 = (currentRow & 0x01) ? 1 : 0;
o0.p2g1 = (currentRow & 0x02) ? 1 : 0;
o0.p2b1 = (currentRow & 0x04) ? 1 : 0;
o0.p2r2 = (currentRow & 0x08) ? 1 : 0;
o0.p2g2 = (currentRow & 0x10) ? 1 : 0;

o0.p3r1 = (currentRow & 0x01) ? 1 : 0;
o0.p3g1 = (currentRow & 0x02) ? 1 : 0;
o0.p3b1 = (currentRow & 0x04) ? 1 : 0;
o0.p3r2 = (currentRow & 0x08) ? 1 : 0;
o0.p3g2 = (currentRow & 0x10) ? 1 : 0;

// set pointer to the byte past the end of the pixel data to shift, and write the currentRow address
uint32_t * tempptr2 = (uint32_t*)matrixUpdateData + ((freeRowBuffer*dmaBufferBytesPerRow)/sizeof(uint32_t)) + (((PIXELS_PER_LATCH)*dmaBufferBytesPerPixel)/sizeof(uint32_t));
@@ -1536,21 +1544,25 @@ INLINE void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, opt
o0.p0g1 = (currentRow & 0x02) ? 1 : 0;
o0.p0b1 = (currentRow & 0x04) ? 1 : 0;
o0.p0r2 = (currentRow & 0x08) ? 1 : 0;
o0.p0g2 = (currentRow & 0x10) ? 1 : 0;

o0.p1r1 = (currentRow & 0x01) ? 1 : 0;
o0.p1g1 = (currentRow & 0x02) ? 1 : 0;
o0.p1b1 = (currentRow & 0x04) ? 1 : 0;
o0.p1r2 = (currentRow & 0x08) ? 1 : 0;
o0.p1g2 = (currentRow & 0x10) ? 1 : 0;

o0.p2r1 = (currentRow & 0x01) ? 1 : 0;
o0.p2g1 = (currentRow & 0x02) ? 1 : 0;
o0.p2b1 = (currentRow & 0x04) ? 1 : 0;
o0.p2r2 = (currentRow & 0x08) ? 1 : 0;
o0.p2g2 = (currentRow & 0x10) ? 1 : 0;

o0.p3r1 = (currentRow & 0x01) ? 1 : 0;
o0.p3g1 = (currentRow & 0x02) ? 1 : 0;
o0.p3b1 = (currentRow & 0x04) ? 1 : 0;
o0.p3r2 = (currentRow & 0x08) ? 1 : 0;
o0.p3g2 = (currentRow & 0x10) ? 1 : 0;

// set pointer to the byte past the end of the pixel data to shift, and write the currentRow address
uint32_t * tempptr2 = (uint32_t*)matrixUpdateData + ((freeRowBuffer*dmaBufferBytesPerRow)/sizeof(uint32_t)) + (((PIXELS_PER_LATCH)*dmaBufferBytesPerPixel)/sizeof(uint32_t));

0 comments on commit 43dea74

Please sign in to comment.
You can’t perform that action at this time.