I am currently working to calibrate resistive touchscreen using emWin library. I see a sample code provided in the library Touch_calibrate.c

As I am working on this, I can see that the code seems to be stuck at while (State.Pressed != 1) .
Also, I was able to implement Touch_sample.c and detect touch to see values changing for both analog inputs and positions.

Thank you for your response.
When you say "I never pass an up event (State.Pressed == 0) to emwin", what do you mean? Is there a part of configuration files where I have to manually add (State.Pressed == 0) ?

I tried to exchange calls of GUI_TOUCH_GetState() into GUI_PID_GetState() and now even when there is no touch, the code seems to exit out of the (State.Pressed == 0) loop.