omap3530/beagle_drivers/byd_touch/xyin/xyin.cpp
branchBeagle_BSP_dev
changeset 95 450a8cf0c020
parent 85 d93b485c1325
--- a/omap3530/beagle_drivers/byd_touch/xyin/xyin.cpp	Thu Oct 07 00:37:22 2010 +0100
+++ b/omap3530/beagle_drivers/byd_touch/xyin/xyin.cpp	Tue Nov 02 00:33:23 2010 +0000
@@ -284,7 +284,7 @@
 		r = GPIO::SetInterruptTrigger(KDataReadyPin, GPIO::EEdgeRising);
 		if(r == KErrNone)
 			{
-			GPIO::SetDebounceTime(KDataReadyPin, 500);
+			GPIO::SetDebounceTime(KDataReadyPin, 100);
 			SCM::SetPadConfig(CONTROL_PADCONF_MMC2_DAT0, SCM::EMsw, SCM::EMode4 | SCM::EInputEnable); // 133 (mmc2dat1)
 			r = GPIO::SetPinMode(KDataReadyPin, GPIO::EEnabled);
 			}
@@ -297,17 +297,7 @@
 
 		// some of the pre-configuration of the touch controller could be done here..
 		iController.HardReset();
-		iController.SetTouchMode(TouchController::ESingle);
-
-		TPoint winStart, winStop;
-		winStart.iX = 0;
-		winStart.iY = 0;
-		winStop.iX = 0xfff;
-		winStop.iY = 0xfff;
-		iController.EnableWindowMode(winStart, winStop);
-
-		iController.SetNumberOfRows(8);
-		iController.SetNumberOfColumns(8);
+		iController.Configure(TouchController::EModeSingle);
 
 		DigitiserPowerUp();
 		}
@@ -352,10 +342,20 @@
 	// Read from appropriate hardware register to determine whether digitiser panel is being touched
 	// Set penDown to ETrue if touched or EFalse if not touched.
 	//
+	TPoint points[4];
+	TInt num_points = 0;
+	TInt r = iController.GetMeasurements(points, num_points);
+	Kern::Printf("Num touches: %d", num_points);
+	Kern::Printf("Measurments: (r: %d)", r);
+	for(TInt i = 0; i < num_points; i++)
+		{
+		Kern::Printf("%d: iX: %d, iY: %d",i, points[i].iX, points[i].iY);
+		}
 
-//	DEBUG_PRINT(Kern::Printf("TS: S%d PD%d Sp%d", (TInt)iState, penDown?1:0, iSamplesCount));
-	TInt penDown = iController.NumOfTouches();
-	Kern::Printf("Num touches: %d", penDown);
+	TInt penDown = num_points;
+
+	//	DEBUG_PRINT(Kern::Printf("TS: S%d PD%d Sp%d", (TInt)iState, penDown?1:0, iSamplesCount));
+
 	if (iState==E_HW_PowerUp)
 		{
 		// waiting for pen to go up after switch on due to pen down or through the HAL
@@ -422,15 +422,6 @@
 	//
 	TPoint aResults;
 
-	TPoint points[4];
-	TInt num_points = 0;
-	TInt r = iController.GetMeasurements(points, num_points);
-	Kern::Printf("Measurments: (r: %d)", r);
-	for(TInt i = 0; i < 4/* num_points*/; i++)
-		{
-		Kern::Printf("%d: iX: %d, iY: %d",i, points[i].iX, points[i].iY);
-		}
-
 	// X axis
 	iX[iSamplesCount] = aResults.iX;
 	// Y axis