Update touch calibration to fix inverted touch panel on STM32F429I-DISC1 RevE-01.
This commit is contained in:
parent
a1d7879ca5
commit
d7fef24505
|
@ -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
|
||||||
|
|
|
@ -145,10 +145,26 @@ void BSP_TS_GetState(TS_StateTypeDef* TsState)
|
||||||
if(TsState->TouchDetected)
|
if(TsState->TouchDetected)
|
||||||
{
|
{
|
||||||
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 value first correction */
|
||||||
y -= 360;
|
y = 3700 - y;
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* Y value first correction */
|
||||||
|
y -= 360;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Y value second correction */
|
/* Y value second correction */
|
||||||
yr = y / 11;
|
yr = y / 11;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue