Fix for driver init

This commit is contained in:
Ken Van Hoeylandt 2026-06-21 23:13:21 +02:00
parent 5090a4bf4a
commit 0098a8be8a

View File

@ -22,12 +22,13 @@ bool Gt911Touch::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS;
} else if (i2c_controller_has_device_at_address(i2c, ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP, pdMS_TO_TICKS(10)) == ERROR_NONE) {
io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP;
io_config.scl_speed_hz = esp32_i2c_master_get_clock_frequency(configuration->i2cController);
} else {
LOGGER.error("No device found on I2C bus");
return false;
}
io_config.scl_speed_hz = esp32_i2c_master_get_clock_frequency(configuration->i2cController);
auto* driver = device_get_driver(i2c);
if (driver_is_compatible(driver, "espressif,esp32-i2c")) {
auto port = static_cast<const Esp32I2cConfig*>(i2c->config)->port;