Update touch calibration to fix inverted touch panel on STM32F429I-DISC1 RevE-01.

This commit is contained in:
Eya 2023-03-28 15:38:43 +01:00
parent a1d7879ca5
commit d7fef24505
2 changed files with 21 additions and 5 deletions

View File

@ -18,8 +18,8 @@
*/ */
/* IMPORTANT: One of the following flags must be defined in the preprocessor */ /* IMPORTANT: One of the following flags must be defined in the preprocessor */
/* options in order to select the target board revision: !!!!!!!!!! */ /* options in order to select the target board revision: !!!!!!!!!! */
/* USE_STM32F429I_DISCO */ /* Applicable for all boards execept STM32F429I DISCOVERY REVD */ /* USE_STM32F429I_DISCO */ /* Applicable for all boards except STM32F429I DISCOVERY REVD and above */
/* USE_STM32F429I_DISCOVERY_REVD */ /* Applicable only for STM32F429I DISCOVERY REVD */ /* USE_STM32F429I_DISCOVERY_REVD */ /* Applicable only for STM32F429I DISCOVERY REVD and above */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F429I_DISCOVERY_H #ifndef __STM32F429I_DISCOVERY_H

View File

@ -146,9 +146,25 @@ void BSP_TS_GetState(TS_StateTypeDef* TsState)
{ {
TsDrv->GetXY(TS_I2C_ADDRESS, &x, &y); TsDrv->GetXY(TS_I2C_ADDRESS, &x, &y);
#if defined (USE_STM32F429I_DISCOVERY_REVD)
if (y > 3700)
{
y = 3700;
}
else if (y < 180)
{
y = 180;
}
/* Y value first correction */
y = 3700 - y;
#else
/* Y value first correction */ /* Y value first correction */
y -= 360; y -= 360;
#endif
/* Y value second correction */ /* Y value second correction */
yr = y / 11; yr = y / 11;