Skip to content

Commit

Permalink
Fix color_space handling.
Browse files Browse the repository at this point in the history
Fixes: #1
  • Loading branch information
atanisoft committed Nov 10, 2022
1 parent ca01e39 commit a6cf491
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions esp_lcd_ili9488.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,18 @@ esp_err_t esp_lcd_new_panel_ili9488(
}

ili9488->madctl_val = LCD_CMD_MX_BIT | LCD_CMD_BGR_BIT;
if (panel_dev_config->color_space == ESP_LCD_COLOR_SPACE_RGB)
switch (panel_dev_config->color_space)
{
ESP_LOGI(TAG, "Configuring for RGB color order");
ili9488->madctl_val &= ~LCD_CMD_BGR_BIT;
}
else
{
ESP_LOGI(TAG, "Configuring for BGR color order");
case ESP_LCD_COLOR_SPACE_RGB:
ESP_LOGI(TAG, "Configuring for RGB color order");
ili9488->madctl_val &= ~LCD_CMD_BGR_BIT;
break;
case ESP_LCD_COLOR_SPACE_BGR:
ESP_LOGI(TAG, "Configuring for BGR color order");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG,
"Unsupported color mode!");
}

if (panel_dev_config->bits_per_pixel == 16)
Expand Down

0 comments on commit a6cf491

Please sign in to comment.