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 */
/* options in order to select the target board revision: !!!!!!!!!! */
/* USE_STM32F429I_DISCO */ /* Applicable for all boards execept STM32F429I DISCOVERY REVD */
/* USE_STM32F429I_DISCOVERY_REVD */ /* Applicable only for 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 and above */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F429I_DISCOVERY_H

View File

@ -145,10 +145,26 @@ void BSP_TS_GetState(TS_StateTypeDef* TsState)
if(TsState->TouchDetected)
{
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 -= 360;
y = 3700 - y;
#else
/* Y value first correction */
y -= 360;
#endif
/* Y value second correction */
yr = y / 11;