Skip to content

Commit

Permalink
Added support for 64-row /32 scan with SmartMatrix Shield V4
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Beaudoin committed Feb 17, 2018
1 parent c7fb410 commit 43dea74
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/SmartMatrix3.h
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions src/SmartMatrix_Impl.h
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 43dea74

Please sign in to comment.