mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 06:27:29 +00:00
fix(lcd): build errors with deprecated lcd types in cpp
Closes https://github.com/espressif/esp-idf/issues/14029
This commit is contained in:
@@ -19,8 +19,8 @@ extern "C" {
|
||||
typedef struct {
|
||||
int reset_gpio_num; /*!< GPIO used to reset the LCD panel, set to -1 if it's not used */
|
||||
union {
|
||||
lcd_rgb_element_order_t color_space; /*!< @deprecated Set RGB color space, please use rgb_ele_order instead */
|
||||
lcd_rgb_element_order_t rgb_endian; /*!< @deprecated Set RGB data endian, please use rgb_ele_order instead */
|
||||
esp_lcd_color_space_t color_space; /*!< @deprecated Set RGB color space, please use rgb_ele_order instead */
|
||||
lcd_color_rgb_endian_t rgb_endian; /*!< @deprecated Set RGB data endian, please use rgb_ele_order instead */
|
||||
lcd_rgb_element_order_t rgb_ele_order; /*!< Set RGB element order, RGB or BGR */
|
||||
};
|
||||
lcd_rgb_data_endian_t data_endian; /*!< Set the data endian for color data larger than 1 byte */
|
||||
|
@@ -16,20 +16,15 @@ typedef struct esp_lcd_panel_io_t *esp_lcd_panel_io_handle_t; /*!< Type of LCD p
|
||||
typedef struct esp_lcd_panel_t *esp_lcd_panel_handle_t; /*!< Type of LCD panel handle */
|
||||
|
||||
/** @cond */
|
||||
/**
|
||||
* @brief LCD color space type definition (WRONG!)
|
||||
* @deprecated RGB and BGR should belong to the same color space, but this enum take them both as two different color spaces.
|
||||
* If you want to use a enum to describe a color space, please use lcd_color_space_t instead.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_LCD_COLOR_SPACE_RGB, /*!< Color space: RGB */
|
||||
ESP_LCD_COLOR_SPACE_BGR, /*!< Color space: BGR */
|
||||
ESP_LCD_COLOR_SPACE_MONOCHROME, /*!< Color space: monochrome */
|
||||
} esp_lcd_color_space_t __attribute__((deprecated));
|
||||
/// for backward compatible
|
||||
typedef lcd_rgb_element_order_t lcd_color_rgb_endian_t;
|
||||
#define LCD_RGB_ENDIAN_RGB (lcd_color_rgb_endian_t)LCD_RGB_ELEMENT_ORDER_RGB
|
||||
#define LCD_RGB_ENDIAN_BGR (lcd_color_rgb_endian_t)LCD_RGB_ELEMENT_ORDER_BGR
|
||||
|
||||
// Ensure binary compatibility with lcd_color_rgb_endian_t
|
||||
ESP_STATIC_ASSERT((lcd_rgb_element_order_t)ESP_LCD_COLOR_SPACE_RGB == LCD_RGB_ELEMENT_ORDER_RGB, "ESP_LCD_COLOR_SPACE_RGB is not compatible with LCD_RGB_ORDER_RGB");
|
||||
ESP_STATIC_ASSERT((lcd_rgb_element_order_t)ESP_LCD_COLOR_SPACE_BGR == LCD_RGB_ELEMENT_ORDER_BGR, "ESP_LCD_COLOR_SPACE_BGR is not compatible with LCD_RGB_ORDER_BGR");
|
||||
typedef lcd_rgb_element_order_t esp_lcd_color_space_t;
|
||||
#define ESP_LCD_COLOR_SPACE_RGB (esp_lcd_color_space_t)LCD_RGB_ELEMENT_ORDER_RGB
|
||||
#define ESP_LCD_COLOR_SPACE_BGR (esp_lcd_color_space_t)LCD_RGB_ELEMENT_ORDER_BGR
|
||||
#define ESP_LCD_COLOR_SPACE_MONOCHROME (esp_lcd_color_space_t)2
|
||||
/** @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user