Incorrect calculation of color data size using bits_per_pixel for ST7789 LCD driver (IDFGH-8241) #9729
Closed
3 tasks done
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v4.4.2 1b16ef6
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
No response
Development Kit.
Custom Board
Power Supply used.
External 5V
What is the expected behavior?
When calling
esp-idf/components/esp_lcd/src/esp_lcd_panel_st7789.c
Line 164 in 1b16ef6
What is the actual behavior?
I believe the way that the size of the color data to be transferred to the display is calculated in
panel_st7789_draw_bitmap
esp-idf/components/esp_lcd/src/esp_lcd_panel_st7789.c
Line 189 in 1b16ef6
The ST7789 controller (and other similar ones) support both R5G6B5 (16bpp) and R6G6B6 (18bpp). In the case of 16bpp the calculation works fine as
16 / 8 = 2
. However, for 18bpp, we still get18 / 8 = 2
, which is wrong; it should be3
. The specification states that each color component should occupy the 6 high bits of a byte, which means 3 full bytes are required.Steps to reproduce.
panel_st7789_draw_bitmap
len
inpanel_st7789_draw_bitmap
and see that it's not equal topixel_count * 3bpp
Debug Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: