Skip to content

Commit a6602a4

Browse files
ngphibangfabiobaltieri
authored andcommitted
display: stm32: ltdc: Revert the BGR565/RGB565 formats swap
This reverts the workaround made in the commit: 772fbfe as the proper fix has now been merged upstream. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent bf8c0ae commit a6602a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/display/display_stm32_ltdc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ LOG_MODULE_REGISTER(display_stm32_ltdc, CONFIG_DISPLAY_LOG_LEVEL);
5555
#elif CONFIG_STM32_LTDC_RGB565
5656
#define STM32_LTDC_INIT_PIXEL_SIZE 2u
5757
#define STM32_LTDC_INIT_PIXEL_FORMAT LTDC_PIXEL_FORMAT_RGB565
58-
#define DISPLAY_INIT_PIXEL_FORMAT PIXEL_FORMAT_BGR_565
58+
#define DISPLAY_INIT_PIXEL_FORMAT PIXEL_FORMAT_RGB_565
5959
#else
6060
#error "Invalid LTDC pixel format chosen"
6161
#endif
@@ -110,9 +110,9 @@ static int stm32_ltdc_set_pixel_format(const struct device *dev,
110110
struct display_stm32_ltdc_data *data = dev->data;
111111

112112
switch (format) {
113-
case PIXEL_FORMAT_BGR_565:
113+
case PIXEL_FORMAT_RGB_565:
114114
err = HAL_LTDC_SetPixelFormat(&data->hltdc, LTDC_PIXEL_FORMAT_RGB565, 0);
115-
data->current_pixel_format = PIXEL_FORMAT_BGR_565;
115+
data->current_pixel_format = PIXEL_FORMAT_RGB_565;
116116
data->current_pixel_size = 2u;
117117
break;
118118
case PIXEL_FORMAT_RGB_888:
@@ -158,7 +158,7 @@ static void stm32_ltdc_get_capabilities(const struct device *dev,
158158
data->hltdc.LayerCfg[0].WindowY0;
159159
capabilities->supported_pixel_formats = PIXEL_FORMAT_ARGB_8888 |
160160
PIXEL_FORMAT_RGB_888 |
161-
PIXEL_FORMAT_BGR_565;
161+
PIXEL_FORMAT_RGB_565;
162162
capabilities->screen_info = 0;
163163

164164
capabilities->current_pixel_format = data->current_pixel_format;

0 commit comments

Comments
 (0)