Merge branch 'fix/fix_i2c_olde_example_hang_v6.0' into 'release/v6.0'

fix(i2c_oled): fix example hang when i2c transaction fails (v6.0)

See merge request espressif/esp-idf!50381
This commit is contained in:
morris
2026-07-06 17:07:09 +08:00

View File

@@ -36,6 +36,7 @@ static const char *TAG = "example";
#define EXAMPLE_PIN_NUM_SCL 4
#define EXAMPLE_PIN_NUM_RST -1
#define EXAMPLE_I2C_HW_ADDR 0x3C
#define EXAMPLE_I2C_TRANSACTION_TIMEOUT_MS 1000
// The pixel number in horizontal and vertical
#if CONFIG_EXAMPLE_LCD_CONTROLLER_SSD1306
@@ -149,6 +150,7 @@ void app_main(void)
esp_lcd_panel_io_i2c_config_t io_config = {
.dev_addr = EXAMPLE_I2C_HW_ADDR,
.scl_speed_hz = EXAMPLE_LCD_PIXEL_CLOCK_HZ,
.transaction_timeout_ms = EXAMPLE_I2C_TRANSACTION_TIMEOUT_MS,
.control_phase_bytes = 1, // According to SSD1306 datasheet
.lcd_cmd_bits = EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
.lcd_param_bits = EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet