Adafruit-RGB_matrix_Panel(32*16)
Dependencies: Adafruit-GFX
Revision 1:0078213d3fa4, committed 2014-05-24
- Comitter:
- lelect
- Date:
- Sat May 24 08:38:23 2014 +0000
- Parent:
- 0:06d9443a018f
- Child:
- 2:6136465ffd3a
- Commit message:
- before API replacement
Changed in this revision
RGBmatrixPanel.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RGBmatrixPanel.cpp Fri May 23 15:08:14 2014 +0000 +++ b/RGBmatrixPanel.cpp Sat May 24 08:38:23 2014 +0000 @@ -148,13 +148,12 @@ } // 8/8/8 -> gamma -> 5/6/5 -uint16_t RGBmatrixPanel::Color888( - uint8_t r, uint8_t g, uint8_t b, bool gflag) +uint16_t RGBmatrixPanel::Color888(uint8_t r, uint8_t g, uint8_t b, bool gflag) { if(gflag) { // Gamma-corrected color? - r = pgm_read_byte(&gamma[r]); // Gamma correction table maps - g = pgm_read_byte(&gamma[g]); // 8-bit input to 4-bit output - b = pgm_read_byte(&gamma[b]); + r = gamma[r]; // Gamma correction table maps + g = gamma[g]; // 8-bit input to 4-bit output + b = gamma[b]; return (r << 12) | ((r & 0x8) << 8) | // 4/4/4 -> 5/6/5 (g << 7) | ((g & 0xC) << 3) | (b << 1) | ( b >> 3); @@ -162,8 +161,7 @@ return ((r & 0xF8) << 11) | ((g & 0xFC) << 5) | (b >> 3); } -uint16_t RGBmatrixPanel::ColorHSV( - long hue, uint8_t sat, uint8_t val, bool gflag) +uint16_t RGBmatrixPanel::ColorHSV(long hue, uint8_t sat, uint8_t val, bool gflag) { uint8_t r, g, b, lo; @@ -262,7 +260,7 @@ if(y < nRows) { // Data for the upper half of the display is stored in the lower // bits of each byte. - ptr = &matrixbuff[backindex][y * _rawWidth * (nPlanes - 1) + x]; // Base addr + ptr = &[backindex][y * _rawWidth * (nPlanes - 1) + x]; // Base addr // Plane 0 is a tricky case -- its data is spread about, // stored in least two bits not used by the other planes. ptr[64] &= ~B00000011; // Plane 0 R,G mask out in one op