cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug in touch respond code (TouchGFX 4.16.1)

hesam moshiri
Associate III

Hello,

I can run the GUI on the screen, however, for some unknown reason, the touch does not respond. I have tested the touch function separately in the while loop and it handles the x and y coordinates correctly with the same code and with checking the touch press (I mean what you see below inside sampleTouch, just without "return true", because return true will exit the while loop).

Where is your definition of (0, 0), upper-left corner, or lower-left corner? I have tested both. nothing happens :-(

This is my implementation inside "STM32TouchController.cpp":

bool STM32TouchController::sampleTouch(int32_t &x, int32_t &y) {
 
	if (XPT2046_TouchPressed()) {
		XPT2046_TouchGetCoordinates((uint16_t*) &x, (uint16_t*) &y);
		return true;
	}
 
	return false;
 
}

11 REPLIES 11

Good to hear you found the problem ��

Yes, thank you for your testing and support.

I had a doubt about a bug from the beginning, that why I mentioned a "possible" bug in touchgx ...

��