Skip to content

Commit

Permalink
fix(esp_lcd_touch_cst816s): Fixed compilation error for IDF5.1 and lower
Browse files Browse the repository at this point in the history
  • Loading branch information
espzav committed Jan 10, 2025
1 parent 91ad61a commit a5bbd8d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.4"
version: "1.0.5"
description: ESP LCD Touch CST816S - touch controller CST816S
url: https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch/esp_lcd_touch_cst816s
dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#pragma once

#include "esp_idf_version.h"
#include "esp_lcd_touch.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -40,6 +41,23 @@ esp_err_t esp_lcd_touch_new_i2c_cst816s(const esp_lcd_panel_io_handle_t io, cons
* @brief Touch IO configuration structure
*
*/
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0)
#define ESP_LCD_TOUCH_IO_I2C_CST816S_CONFIG() \
{ \
.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, \
.on_color_trans_done = 0, \
.user_ctx = 0, \
.control_phase_bytes = 1, \
.dc_bit_offset = 0, \
.lcd_cmd_bits = 8, \
.lcd_param_bits = 0, \
.flags = \
{ \
.dc_low_on_data = 0, \
.disable_control_phase = 1, \
} \
}
#else
#define ESP_LCD_TOUCH_IO_I2C_CST816S_CONFIG() \
{ \
.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, \
Expand All @@ -56,6 +74,7 @@ esp_err_t esp_lcd_touch_new_i2c_cst816s(const esp_lcd_panel_io_handle_t io, cons
}, \
.scl_speed_hz = 0 \
}
#endif

#ifdef __cplusplus
}
Expand Down

0 comments on commit a5bbd8d

Please sign in to comment.