summaryrefslogtreecommitdiff
path: root/nuttx/drivers/input/stmpe11_base.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-21 17:36:26 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-21 17:36:26 +0000
commite633774b61f42363d4b7c66218c1e99ebc3fa6bb (patch)
tree2d2dbecb4e03dbbc056748dca54a4ee617fa18be /nuttx/drivers/input/stmpe11_base.c
parent1d1cb9be06ee80a0d3dbcc77561a7d173ff7a659 (diff)
downloadpx4-nuttx-e633774b61f42363d4b7c66218c1e99ebc3fa6bb.tar.gz
px4-nuttx-e633774b61f42363d4b7c66218c1e99ebc3fa6bb.tar.bz2
px4-nuttx-e633774b61f42363d4b7c66218c1e99ebc3fa6bb.zip
Add a timeout to the STMPE11 touchscreen driver to catch missing pen up events
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4758 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/input/stmpe11_base.c')
-rw-r--r--nuttx/drivers/input/stmpe11_base.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/nuttx/drivers/input/stmpe11_base.c b/nuttx/drivers/input/stmpe11_base.c
index 546f1d901..8e2900610 100644
--- a/nuttx/drivers/input/stmpe11_base.c
+++ b/nuttx/drivers/input/stmpe11_base.c
@@ -183,16 +183,23 @@ static int stmpe11_interrupt(int irq, FAR void *context)
config->enable(config, false);
- /* Transfer processing to the worker thread. Since STMPE11 interrupts are
- * disabled while the work is pending, no special action should be required
- * to protected the work queue.
+ /* Check if interrupt work is already queue. If it is already busy, then
+ * we already have interrupt processing in the pipeline and we need to do
+ * nothing more.
*/
- DEBUGASSERT(work_available(&priv->work));
- ret = work_queue(&priv->work, stmpe11_worker, priv, 0);
- if (ret != 0)
+ if (work_available(&priv->work))
{
- illdbg("Failed to queue work: %d\n", ret);
+ /* Yes.. Transfer processing to the worker thread. Since STMPE11
+ * interrupts are disabled while the work is pending, no special
+ * action should be required to protect the work queue.
+ */
+
+ ret = work_queue(&priv->work, stmpe11_worker, priv, 0);
+ if (ret != 0)
+ {
+ illdbg("Failed to queue work: %d\n", ret);
+ }
}
/* Clear any pending interrupts and return success */