Merge pull request #487 from beta-tester/master

minimal optimization and adjustment
This commit is contained in:
mrfaptastic 2023-08-10 08:35:22 +01:00 committed by GitHub
commit 9943fcd97d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -347,9 +347,9 @@ void IRAM_ATTR MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint16_t x_coord, uint
green16 = lumConvTab[green];
blue16 = lumConvTab[blue];
#else
red16 = red << 8;
green16 = green << 8;
blue16 = blue << 8;
red16 = red << 8 | red;
green16 = green << 8 | green;
blue16 = blue << 8 | blue;
#endif
/* When using the drawPixel, we are obviously only changing the value of one x,y position,

View file

@ -880,9 +880,12 @@ private:
*/
inline void MatrixPanel_I2S_DMA::color565to888(const uint16_t color, uint8_t &r, uint8_t &g, uint8_t &b)
{
r = ((((color >> 11) & 0x1F) * 527) + 23) >> 6;
g = ((((color >> 5) & 0x3F) * 259) + 33) >> 6;
b = (((color & 0x1F) * 527) + 23) >> 6;
r = (color >> 8) & 0xf8;
g = (color >> 3) & 0xfc;
b = (color << 3);
r |= r >> 5;
g |= g >> 6;
b |= b >> 5;
}
inline void MatrixPanel_I2S_DMA::drawPixel(int16_t x, int16_t y, uint16_t color) // adafruit virtual void override