How to get touch to work with code generated by Squareline Studio?

Before using SquareLine Studio to generate my layout I have already got my LCD and touch working with LVGL. I am running on ESP32-S3 with a 3.5" LCD with ILI9488 which has the FXP2046 touch controller. I’m using TFT_eSPI and LVGL libraries. With that set up, I have been able to run the Demos in the LVGL library like the demo_widgets, and the touch input works fine. Basically all I had to do was supply MISO and Touch_CS pin defines in the TFT setup files (and disconnect the SDO out of the LCD so it doesn’t interfere with the Touch SDO). BUT, I can’t get touch to work with the code generated by SquareLine Studio. The screens that it generates display fine, but, no touch. I copied over the TFT setup files to that directory, and nothing i’ve tried works. What am I missing? Where or how does LVGL hook up to the touch drivers in TFT_eSPI ? I am using the latest 8.3 something LVGL in both setups.

RESOLVED - Got it working. For others who this may happen to…
Both the TFT_eSPI sample code and the SquareLine Studio generated code, in the main file (or ino for that SquareLine generates) there is a function :
/Read the touchpad/
void my_touchpad_read( lv_indev_drv_t * indev_driver, lv_indev_data_t * data )

I saw the function in both main files, and at a glance they seemed the same. BUT, in the TFT_eSPI sample code the tft.getTouch line is:
bool touched = tft.getTouch( &touchX, &touchY, 600 );

In the SquareLine Studio generated code that line is:
bool touched = false;//tft.getTouch( &touchX, &touchY, 600 );

The get.Touch function is commented out… I spent 2 days pulling out the rest of the hair on my head trying to figure this out… and just after I posted the question, i found the problem. Now that I’m totally bald… Fixed this line, and all is working…

1 Like