From 79e1897aed951e37ee14665b2e13d9c172c8cfaf Mon Sep 17 00:00:00 2001 From: Kouzerumatsu / Bananafox <46141631+Kouzeru@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:33:14 +0800 Subject: [PATCH 1/2] Deeper color depth --- .../4_HueValueSpectrumDemo.ino | 76 +++++----- src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 130 +++++++++--------- src/ESP32-HUB75-MatrixPanel-I2S-DMA.h | 23 ++++ 3 files changed, 131 insertions(+), 98 deletions(-) diff --git a/examples/4_HueValueSpectrumDemo/4_HueValueSpectrumDemo.ino b/examples/4_HueValueSpectrumDemo/4_HueValueSpectrumDemo.ino index 3fcbb31..e64d419 100644 --- a/examples/4_HueValueSpectrumDemo/4_HueValueSpectrumDemo.ino +++ b/examples/4_HueValueSpectrumDemo/4_HueValueSpectrumDemo.ino @@ -2,38 +2,33 @@ #define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module. #define PANEL_CHAIN 1 // Total number of panels chained one to another -#define NO_CIE1931 -#define PIXEL_COLOUR_DEPTH_BITS 8 #include MatrixPanel_I2S_DMA *dma_display = nullptr; -#define R1_PIN 25 -#define G1_PIN 26 -#define B1_PIN 27 -#define R2_PIN 14 -#define G2_PIN 12 -#define B2_PIN 13 -#define A_PIN 23 -#define B_PIN 19 -#define C_PIN 5 -#define D_PIN 17 -#define E_PIN -1 // required for 1/32 scan panels, esp for 64x64 or 128x64 displays -#define LAT_PIN 4 -#define OE_PIN 15 -#define CLK_PIN 16 - -uint32_t lastMillis; - void setup() { - HUB75_I2S_CFG::i2s_pins _pins={R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN, A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, LAT_PIN, OE_PIN, CLK_PIN}; + HUB75_I2S_CFG::i2s_pins _pins={ + 25, //R1_PIN, + 26, //G1_PIN, + 27, //B1_PIN, + 14, //R2_PIN, + 12, //G2_PIN, + 13, //B2_PIN, + 23, //A_PIN, + 19, //B_PIN, + 5, //C_PIN, + 17, //D_PIN, + 18, //E_PIN, + 4, //LAT_PIN, + 15, //OE_PIN, + 16, //CLK_PIN + }; HUB75_I2S_CFG mxconfig( PANEL_RES_X, // Module width PANEL_RES_Y, // Module height - 1, // chain length + PANEL_CHAIN, // chain length _pins // pin mapping ); - //mxconfig.gpio.e = 18; //mxconfig.clkphase = false; //mxconfig.driver = HUB75_I2S_CFG::FM6126A; @@ -46,26 +41,35 @@ void setup() { void loop() { // Canvas loop float t = (float)(millis()%4000)/4000.f; - for(int x = 0; x < PANEL_RES_X; x++){ - float r =max(min(cosf(2.f*PI*(t+(float)x/PANEL_RES_X+0.f/3.f))+0.5f,1.f),0.f); - float g =max(min(cosf(2.f*PI*(t+(float)x/PANEL_RES_X+1.f/3.f))+0.5f,1.f),0.f); - float b =max(min(cosf(2.f*PI*(t+(float)x/PANEL_RES_X+2.f/3.f))+0.5f,1.f),0.f); - for(int y = 0; y < PANEL_RES_Y; y++) + float tt = (float)((millis()%16000)/16000.f; + + for(int x = 0; x < PANEL_RES_X*PANEL_CHAIN; x++){ + // calculate the overal shade + float f = ((sin(tt-(float)x/PANEL_RES_Y/32.)*2.f*PI)+1)/2)*255; + // calculate hue spectrum into rgb + float r = max(min(cosf(2.f*PI*(t+((float)x/PANEL_RES_Y+0.f)/3.f))+0.5f,1.f),0.f); + float g = max(min(cosf(2.f*PI*(t+((float)x/PANEL_RES_Y+1.f)/3.f))+0.5f,1.f),0.f); + float b = max(min(cosf(2.f*PI*(t+((float)x/PANEL_RES_Y+2.f)/3.f))+0.5f,1.f),0.f); + + // iterate pixels for every row + for(int y = 0; y < PANEL_RES_Y; y++){ if(y*2 < PANEL_RES_Y){ - float t = (2.f*y)/PANEL_RES_Y; + // top-middle part of screen, transition of value + float t = (2.f*y+1)/PANEL_RES_Y; dma_display->drawPixelRGB888(x,y, - (r*t)*255, - (g*t)*255, - (b*t)*255 + (r*t)*f, + (g*t)*f, + (b*t)*f ); }else{ - float t = (2.f*(PANEL_RES_Y-y))/PANEL_RES_Y; + // middle to bottom of screen, transition of saturation + float t = (2.f*(PANEL_RES_Y-y)-1)/PANEL_RES_Y; dma_display->drawPixelRGB888(x,y, - (r*t+1-t)*255, - (g*t+1-t)*255, - (b*t+1-t)*255 + (r*t+1-t)*f, + (g*t+1-t)*f, + (b*t+1-t)*f ); } - + } } } diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 4778c5b..c1e7dd6 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -27,19 +27,15 @@ * However, if the library is to be used with lower colour depth (i.e. 6 bit colour), then we need to ensure the 8-bit value passed to the colour masking * is adjusted accordingly to ensure the LSB's are shifted left to MSB, by the difference. Otherwise the colours will be all screwed up. */ -#if PIXEL_COLOUR_DEPTH_BITS > 8 - #error "Color depth bits cannot be greater than 8." +#if PIXEL_COLOUR_DEPTH_BITS > 12 + #error "Color depth bits cannot be greater than 12." #elif PIXEL_COLOUR_DEPTH_BITS < 2 #error "Colour depth bits cannot be less than 2." #endif -#if PIXEL_COLOUR_DEPTH_BITS != 8 - #define MASK_OFFSET (8 - PIXEL_COLOUR_DEPTH_BITS) + #define MASK_OFFSET (16 - PIXEL_COLOUR_DEPTH_BITS) #define PIXEL_COLOUR_MASK_BIT(colour_depth_index) (1 << (colour_depth_index + MASK_OFFSET)) //static constexpr uint8_t const MASK_OFFSET = 8-PIXEL_COLOUR_DEPTH_BITS; -#else - #define PIXEL_COLOUR_MASK_BIT(colour_depth_index) (1 << (colour_depth_index)) -#endif /* #if PIXEL_COLOUR_DEPTH_BITS < 8 @@ -314,10 +310,15 @@ void IRAM_ATTR MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint16_t x_coord, uint * i.e. It's almost impossible for colour_depth_idx of 0 to be sent out to the MATRIX unless the 'value' of a color is exactly '1' * https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ */ +uint16_t red16, green16, blue16; #ifndef NO_CIE1931 - red = lumConvTab[red]; - green = lumConvTab[green]; - blue = lumConvTab[blue]; + red16 = lumConvTab[red]; + green16 = lumConvTab[green]; + blue16 = lumConvTab[blue]; +#else + red16 = red << 8; + green16 = green << 8; + blue16 = blue << 8; #endif /* When using the drawPixel, we are obviously only changing the value of one x,y position, @@ -362,16 +363,16 @@ void IRAM_ATTR MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint16_t x_coord, uint uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit color (8 bits per RGB subpixel) #endif */ - uint8_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); uint16_t RGB_output_bits = 0; /* Per the .h file, the order of the output RGB bits is: * BIT_B2, BIT_G2, BIT_R2, BIT_B1, BIT_G1, BIT_R1 */ - RGB_output_bits |= (bool)(blue & mask); // --B + RGB_output_bits |= (bool)(blue16 & mask); // --B RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(green & mask); // -BG + RGB_output_bits |= (bool)(green16 & mask); // -BG RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(red & mask); // BGR + RGB_output_bits |= (bool)(red16 & mask); // BGR RGB_output_bits <<= _colourbitoffset; // shift colour bits to the required position @@ -398,10 +399,15 @@ void MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint8_t red, uint8_t green, uint if ( !initialized ) return; /* https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ */ +uint16_t red16, green16, blue16; #ifndef NO_CIE1931 - red = lumConvTab[red]; - green = lumConvTab[green]; - blue = lumConvTab[blue]; + red16 = lumConvTab[red]; + green16 = lumConvTab[green]; + blue16 = lumConvTab[blue]; +#else + red16 = red << 8; + green16 = green << 8; + blue16 = blue << 8; #endif for(uint8_t colour_depth_idx=0; colour_depth_idxcolour_depth; + uint16_t _width = dma_buff.rowBits[0]->width; // start with iterating all rows in dma_buff structure int row_idx = dma_buff.rowBits.size(); @@ -699,40 +706,29 @@ void MatrixPanel_I2S_DMA::brtCtrlOEv2(uint8_t brt, const int _buff_id) { --row_idx; // let's set OE control bits for specific pixels in each color_index subrows - uint8_t colouridx = dma_buff.rowBits[row_idx]->colour_depth; + uint8_t colouridx = _depth; do { - // Multiply brightness according to index of bitplane (color index subrow) - // in respect of accumulating LED intensities with Binary-Coded Modulation: - // bitplane 0 is 1/1 of total brightness; bitplane 1 is 1/2; bitplane 2 is 1/4, etc - // accumulating all of them together means we will get only ~1/4 of the total brightness. - - // During the DMA, assume bitplane 0 shown for 4 subrows; bitplane 1 shown for 2 subrows; - // bitplane 2 and the rest shown for one subrow, would give us ~2/3 of the total brightness, - // which is good balance for the depth, brightness, while the flickers still less noticeable: - // row 0 (blanking)\ row 1 (blanking)\ row 2 (blanking)\ .. - // bitplane : ... 0 0 0 0 1 1 2 3 4 5 6 7 \- 0 0 0 0 1 1 2 3 4 5 6 7 \- 0 0 0 0 1 1 2 3 4 5 6 7 \- .. - // rightshift: ... 0 0 0 0 0 0 0 1 2 3 4 5 -\ 0 0 0 0 0 0 0 1 2 3 4 5 -\ 0 0 0 0 0 0 0 1 2 3 4 5 -\ .. - char bitplane = dma_buff.rowBits[row_idx]->colour_depth-colouridx; - char rightshift = std::max(bitplane-2,0); - int brightness_in_x_pixels = (PIXELS_PER_ROW * brt) >> (8 + rightshift); --colouridx; - + + char bitplane = ( 2 * _depth - colouridx ) % _depth; + char bitshift = _depth - lsbMsbTransitionBit - 1 >> 1; + + char rightshift = std::max( bitplane - bitshift - 2, 0 ); + // calculate the OE disable period by brightness, and also blanking + int brightness_in_x_pixels = ( ( _width - _blank ) * brt) >> (8 + rightshift); + // switch pointer to a row for a specific color index ESP32_I2S_DMA_STORAGE_TYPE* row = dma_buff.rowBits[row_idx]->getDataPtr(colouridx, _buff_id); - int x_coord = dma_buff.rowBits[row_idx]->width; + // define range of Output Enable on the center of the row + int x_coord_max = ( _width + brightness_in_x_pixels + 1 ) >> 1; + int x_coord_min = ( _width - brightness_in_x_pixels + 0 ) >> 1; + int x_coord = _width; do { --x_coord; - if (x_coord <= _blank) // Can't touch blanking. They need to stay blank. - { - row[ESP32_TX_FIFO_POSITION_ADJUST(x_coord)] |= BIT_OE; // Disable output after this point. - } - else if(x_coord >= (PIXELS_PER_ROW - _blank - 1) ) // Can't touch blanking. They need to stay blank. - { - row[ESP32_TX_FIFO_POSITION_ADJUST(x_coord)] |= BIT_OE; // Disable output after this point. - } - else if (x_coord < brightness_in_x_pixels) + // (the check is already including "blanking" ) + if (x_coord >= x_coord_min && x_coord < x_coord_max) { row[ESP32_TX_FIFO_POSITION_ADJUST(x_coord)] &= BITMASK_OE_CLEAR; } @@ -844,10 +840,15 @@ void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, // l = PIXELS_PER_ROW - x_coord + 1; // reset width to end of row /* LED Brightness Compensation */ +uint16_t red16, green16, blue16; #ifndef NO_CIE1931 - red = lumConvTab[red]; - green = lumConvTab[green]; - blue = lumConvTab[blue]; + red16 = lumConvTab[red]; + green16 = lumConvTab[green]; + blue16 = lumConvTab[blue]; +#else + red16 = red << 8; + green16 = green << 8; + blue16 = blue << 8; #endif uint16_t _colourbitclear = BITMASK_RGB1_CLEAR, _colourbitoffset = 0; @@ -871,15 +872,15 @@ void MatrixPanel_I2S_DMA::hlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, // #else // uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit color (8 bits per RGB subpixel) // #endif - uint8_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); /* Per the .h file, the order of the output RGB bits is: * BIT_B2, BIT_G2, BIT_R2, BIT_B1, BIT_G1, BIT_R1 */ - RGB_output_bits |= (bool)(blue & mask); // --B + RGB_output_bits |= (bool)(blue16 & mask); // --B RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(green & mask); // -BG + RGB_output_bits |= (bool)(green16 & mask); // -BG RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(red & mask); // BGR + RGB_output_bits |= (bool)(red16 & mask); // BGR RGB_output_bits <<= _colourbitoffset; // shift color bits to the required position // Get the contents at this address, @@ -930,10 +931,15 @@ void MatrixPanel_I2S_DMA::vlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, /// l = m_cfg.mx_height - y_coord + 1; // reset width to end of col /* LED Brightness Compensation */ +uint16_t red16, green16, blue16; #ifndef NO_CIE1931 - red = lumConvTab[red]; - green = lumConvTab[green]; - blue = lumConvTab[blue]; + red16 = lumConvTab[red]; + green16 = lumConvTab[green]; + blue16 = lumConvTab[blue]; +#else + red16 = red << 8; + green16 = green << 8; + blue16 = blue << 8; #endif /* @@ -956,16 +962,16 @@ void MatrixPanel_I2S_DMA::vlineDMA(int16_t x_coord, int16_t y_coord, int16_t l, // uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit color (8 bits per RGB subpixel) // #endif - uint8_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); uint16_t RGB_output_bits = 0; /* Per the .h file, the order of the output RGB bits is: * BIT_B2, BIT_G2, BIT_R2, BIT_B1, BIT_G1, BIT_R1 */ - RGB_output_bits |= (bool)(blue & mask); // --B + RGB_output_bits |= (bool)(blue16 & mask); // --B RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(green & mask); // -BG + RGB_output_bits |= (bool)(green16 & mask); // -BG RGB_output_bits <<= 1; - RGB_output_bits |= (bool)(red & mask); // BGR + RGB_output_bits |= (bool)(red16 & mask); // BGR int16_t _l = 0, _y = y_coord; uint16_t _colourbitclear = BITMASK_RGB1_CLEAR; diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 2b76152..200530e 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -65,6 +65,7 @@ #endif // 8bit per RGB color = 24 bit/per pixel, +// can be extended to offer deeper colors, or // might be reduced to save DMA RAM #ifndef PIXEL_COLOUR_DEPTH_BITS #define PIXEL_COLOUR_DEPTH_BITS 8 @@ -182,8 +183,30 @@ struct frameStruct { // Example calculator: https://gist.github.com/mathiasvr/19ce1d7b6caeab230934080ae1f1380e // need to make sure this would end up in RAM for fastest access #ifndef NO_CIE1931 +/* static const uint8_t DRAM_ATTR lumConvTab[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 30, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 90, 91, 92, 93, 95, 96, 98, 99, 100, 102, 103, 105, 106, 107, 109, 110, 112, 113, 115, 116, 118, 120, 121, 123, 124, 126, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, 156, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 192, 194, 196, 198, 200, 203, 205, 207, 209, 212, 214, 216, 218, 221, 223, 226, 228, 230, 233, 235, 238, 240, 243, 245, 248, 250, 253, 255, 255}; +*/ +// This is 16-bit version of the table, +// the constants taken from the example in the article above, each entries subtracted from 65535: +static const uint16_t DRAM_ATTR lumConvTab[]={ + 0, 27, 56, 84, 113, 141, 170, 198, 227, 255, 284, 312, 340, 369, 397, 426, + 454, 483, 511, 540, 568, 597, 626, 657, 688, 720, 754, 788, 824, 860, 898, 936, + 976, 1017, 1059, 1102, 1146, 1191, 1238, 1286, 1335, 1385, 1436, 1489, 1543, 1598, 1655, 1713, + 1772, 1833, 1895, 1958, 2023, 2089, 2156, 2225, 2296, 2368, 2441, 2516, 2592, 2670, 2750, 2831, + 2914, 2998, 3084, 3171, 3260, 3351, 3443, 3537, 3633, 3731, 3830, 3931, 4034, 4138, 4245, 4353, + 4463, 4574, 4688, 4803, 4921, 5040, 5161, 5284, 5409, 5536, 5665, 5796, 5929, 6064, 6201, 6340, + 6482, 6625, 6770, 6917, 7067, 7219, 7372, 7528, 7687, 7847, 8010, 8174, 8341, 8511, 8682, 8856, + 9032, 9211, 9392, 9575, 9761, 9949, 10139, 10332, 10527, 10725, 10925, 11127, 11332, 11540, 11750, 11963, + 12178, 12395, 12616, 12839, 13064, 13292, 13523, 13757, 13993, 14231, 14473, 14717, 14964, 15214, 15466, 15722, + 15980, 16240, 16504, 16771, 17040, 17312, 17587, 17865, 18146, 18430, 18717, 19006, 19299, 19595, 19894, 20195, + 20500, 20808, 21119, 21433, 21750, 22070, 22393, 22720, 23049, 23382, 23718, 24057, 24400, 24745, 25094, 25446, + 25802, 26160, 26522, 26888, 27256, 27628, 28004, 28382, 28765, 29150, 29539, 29932, 30328, 30727, 31130, 31536, + 31946, 32360, 32777, 33197, 33622, 34049, 34481, 34916, 35354, 35797, 36243, 36692, 37146, 37603, 38064, 38528, + 38996, 39469, 39945, 40424, 40908, 41395, 41886, 42382, 42881, 43383, 43890, 44401, 44916, 45434, 45957, 46484, + 47014, 47549, 48088, 48630, 49177, 49728, 50283, 50842, 51406, 51973, 52545, 53120, 53700, 54284, 54873, 55465, + 56062, 56663, 57269, 57878, 58492, 59111, 59733, 60360, 60992, 61627, 62268, 62912, 63561, 64215, 64873, 65535 +}; #endif /** @brief - configuration values for HUB75_I2S driver From 5a12ff59a21cadd501432c7360856a8fede1f0f7 Mon Sep 17 00:00:00 2001 From: Kouzerumatsu / Bananafox <46141631+Kouzeru@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:51:51 +0800 Subject: [PATCH 2/2] Update ESP32-HUB75-MatrixPanel-I2S-DMA.cpp --- src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 65429c3..0f71e52 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -27,14 +27,14 @@ * However, if the library is to be used with lower colour depth (i.e. 6 bit colour), then we need to ensure the 8-bit value passed to the colour masking * is adjusted accordingly to ensure the LSB's are shifted left to MSB, by the difference. Otherwise the colours will be all screwed up. */ -#if PIXEL_COLOUR_DEPTH_BITS > 12 +#if PIXEL_COLOR_DEPTH_BITS > 12 #error "Color depth bits cannot be greater than 12." -#elif PIXEL_COLOUR_DEPTH_BITS < 2 - #error "Colour depth bits cannot be less than 2." +#elif PIXEL_COLOR_DEPTH_BITS < 2 + #error "Color depth bits cannot be less than 2." #endif - #define MASK_OFFSET (16 - PIXEL_COLOUR_DEPTH_BITS) - #define PIXEL_COLOUR_MASK_BIT(colour_depth_index) (1 << (colour_depth_index + MASK_OFFSET)) + #define MASK_OFFSET (16 - PIXEL_COLOR_DEPTH_BITS) + #define PIXEL_COLOR_MASK_BIT(color_depth_index) (1 << (color_depth_index + MASK_OFFSET)) //static constexpr uint8_t const MASK_OFFSET = 8-PIXEL_COLOUR_DEPTH_BITS; /* @@ -363,7 +363,7 @@ uint16_t red16, green16, blue16; uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit color (8 bits per RGB subpixel) #endif */ - uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOR_MASK_BIT(colour_depth_idx); uint16_t RGB_output_bits = 0; /* Per the .h file, the order of the output RGB bits is: @@ -421,7 +421,7 @@ uint16_t red16, green16, blue16; // uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit colour (8 bits per RGB subpixel) // #endif - uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOR_MASK_BIT(colour_depth_idx); /* Per the .h file, the order of the output RGB bits is: * BIT_B2, BIT_G2, BIT_R2, BIT_B1, BIT_G1, BIT_R1 */ @@ -872,7 +872,7 @@ uint16_t red16, green16, blue16; // #else // uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit colour (8 bits per RGB subpixel) // #endif - uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOR_MASK_BIT(colour_depth_idx); /* Per the .h file, the order of the output RGB bits is: * BIT_B2, BIT_G2, BIT_R2, BIT_B1, BIT_G1, BIT_R1 */ @@ -962,7 +962,7 @@ uint16_t red16, green16, blue16; // uint8_t mask = (1 << (colour_depth_idx)); // expect 24 bit colour (8 bits per RGB subpixel) // #endif - uint16_t mask = PIXEL_COLOUR_MASK_BIT(colour_depth_idx); + uint16_t mask = PIXEL_COLOR_MASK_BIT(colour_depth_idx); uint16_t RGB_output_bits = 0; /* Per the .h file, the order of the output RGB bits is: