SAMA5: Touchscreen driver now works

This commit is contained in:
Gregory Nutt
2013-10-04 08:03:38 -06:00
parent 6ca0850605
commit a8951de086
+7 -8
View File
@@ -649,8 +649,11 @@ static void sam_tsd_bottomhalf(void *arg)
* wait until it is.
*/
if ((priv->valid & TSD_ALLREADY) == TSD_ALLREADY)
if ((priv->valid & TSD_ALLREADY) != TSD_ALLREADY)
{
goto ignored;
}
/* Clear data ready bits in the data validity bitset */
priv->valid = 0;
@@ -693,15 +696,12 @@ static void sam_tsd_bottomhalf(void *arg)
* pressure also generate a event?
*/
xdiff = x > priv->threshx ? (x - priv->threshx) :
(priv->threshx - x);
ydiff = y > priv->threshy ? (y - priv->threshy) :
(priv->threshy - y);
xdiff = x > priv->threshx ? (x - priv->threshx) : (priv->threshx - x);
ydiff = y > priv->threshy ? (y - priv->threshy) : (priv->threshy - y);
/* Continue to sample the position while the pen is down */
wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry,
1, (uint32_t)priv);
wd_start(priv->wdog, TSD_WDOG_DELAY, sam_tsd_expiry, 1, (uint32_t)priv);
/* Check the thresholds. Bail if (1) this is not the first
* measurement and (2) there is no significant difference from
@@ -774,7 +774,6 @@ static void sam_tsd_bottomhalf(void *arg)
sam_adc_putreg(priv->adc, SAM_ADC_TRGR, regval);
}
}
}
/* Indicate the availability of new sample data for this ID */