STM32LTDC: Improve pixel format detection if 2nd layer is used

This is necessary as using double buffering via STM32LTDC_USE_DOUBLEBUFFERING will also result in GDISP_TOTAL_DISPLAYS being larger than 1.
develop
Joel Bodenmann 2021-08-18 17:12:12 +02:00
parent 72200af286
commit 77f10024e0
1 changed files with 2 additions and 2 deletions

View File

@ -22,8 +22,8 @@
// RGB565 obviously is faster and uses less RAM but with lower color resolution than RGB888
#if defined(STM32LTDC_USE_RGB565) && STM32LTDC_USE_RGB565
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
#if GDISP_TOTAL_DISPLAYS > 1
#error "GDISP - STM32LTDC: You must use RGB888 pixel format with LTDC when using dual layers as only RGB888 currently supports using alpha"
#if defined(STM32LTDC_USE_LAYER2) && STM32LTDC_USE_LAYER2
#error "GDISP - STM32LTDC: You must use RGB888 pixel format with LTDC when using both layers as only RGB888 currently supports using alpha."
#endif
#else
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB888