diff --git a/src/drv/touch/touch_driver_gt911.h b/src/drv/touch/touch_driver_gt911.h index 26fe013b..cc544527 100644 --- a/src/drv/touch/touch_driver_gt911.h +++ b/src/drv/touch/touch_driver_gt911.h @@ -98,12 +98,14 @@ class TouchGt911 : public BaseTouch { void init(int w, int h) { + Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY); + touch.setHandler(GT911_setXY); + if(touch.begin(TOUCH_IRQ, TOUCH_RST, I2C_TOUCH_ADDRESS)) { LOG_INFO(TAG_DRVR, F("GT911 " D_SERVICE_STARTED)); } else { LOG_WARNING(TAG_DRVR, F("GT911 " D_SERVICE_START_FAILED)); } - touch.setHandler(GT911_setXY); Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY); touch_scan(Wire); // The address could change during begin, so scan afterwards