summaryrefslogtreecommitdiffstats
path: root/nuttx/configs/stm3240g-eval
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-11 18:27:46 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-11 18:27:46 +0000
commit21e01e51bfc8692ef0b13ce91654f9e051eafd62 (patch)
tree77ec188ac358d775f36b3d77fde24509afe7fd26 /nuttx/configs/stm3240g-eval
parentbd3b970ffe0ac3c40eb22b9e74784d06400ef749 (diff)
SMTPE11 and NxWM touchscreen fixes
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4722 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/stm3240g-eval')
-rw-r--r--nuttx/configs/stm3240g-eval/nsh/defconfig5
-rw-r--r--nuttx/configs/stm3240g-eval/nxwm/defconfig5
-rw-r--r--nuttx/configs/stm3240g-eval/src/up_stmpe11.c11
3 files changed, 17 insertions, 4 deletions
diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig
index 5f89450756..a0131c9932 100644
--- a/nuttx/configs/stm3240g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh/defconfig
@@ -968,7 +968,9 @@ CONFIG_INPUT_TSC2007=n
# CONFIG_STMPE11_MULTIPLE
# Can be defined to support multiple STMPE11 devices on board.
# CONFIG_STMPE11_ACTIVELOW
-# Interrupt is generated by an active low signal.
+# Interrupt is generated by an active low signal (or falling edge).
+# CONFIG_STMPE11_EDGE
+# Interrupt is generated on an edge (vs. on the active level)
# CONFIG_STMPE11_NPOLLWAITERS
# Maximum number of threads that can be waiting on poll() (ignored if
# CONFIG_DISABLE_POLL is set).
@@ -994,6 +996,7 @@ CONFIG_STMPE11_SPI=n
CONFIG_STMPE11_I2C=y
CONFIG_STMPE11_MULTIPLE=y
CONFIG_STMPE11_ACTIVELOW=y
+CONFIG_STMPE11_EDGE=y
#CONFIG_STMPE11_NPOLLWAITERS
CONFIG_STMPE11_TSC_DISABLE=n
CONFIG_STMPE11_ADC_DISABLE=y
diff --git a/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig
index 10ffa08795..3242948f30 100644
--- a/nuttx/configs/stm3240g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxwm/defconfig
@@ -968,7 +968,9 @@ CONFIG_INPUT_TSC2007=n
# CONFIG_STMPE11_MULTIPLE
# Can be defined to support multiple STMPE11 devices on board.
# CONFIG_STMPE11_ACTIVELOW
-# Interrupt is generated by an active low signal.
+# Interrupt is generated by an active low signal (or falling edge).
+# CONFIG_STMPE11_EDGE
+# Interrupt is generated on an edge (vs. on the active level)
# CONFIG_STMPE11_NPOLLWAITERS
# Maximum number of threads that can be waiting on poll() (ignored if
# CONFIG_DISABLE_POLL is set).
@@ -994,6 +996,7 @@ CONFIG_STMPE11_SPI=n
CONFIG_STMPE11_I2C=y
CONFIG_STMPE11_MULTIPLE=y
CONFIG_STMPE11_ACTIVELOW=y
+CONFIG_STMPE11_EDGE=y
#CONFIG_STMPE11_NPOLLWAITERS
CONFIG_STMPE11_TSC_DISABLE=n
CONFIG_STMPE11_ADC_DISABLE=y
diff --git a/nuttx/configs/stm3240g-eval/src/up_stmpe11.c b/nuttx/configs/stm3240g-eval/src/up_stmpe11.c
index e06e203e71..72482c92cc 100644
--- a/nuttx/configs/stm3240g-eval/src/up_stmpe11.c
+++ b/nuttx/configs/stm3240g-eval/src/up_stmpe11.c
@@ -49,6 +49,8 @@
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/stmpe11.h>
+#include <arch/irq.h>
+
#include "stm32_internal.h"
#include "stm3240g-internal.h"
@@ -221,10 +223,14 @@ static int stmpe11_attach(FAR struct stmpe11_config_s *state, xcpt_t isr)
static void stmpe11_enable(FAR struct stmpe11_config_s *state, bool enable)
{
FAR struct stm32_stmpe11config_s *priv = (FAR struct stm32_stmpe11config_s *)state;
+ irqstate_t flags;
- /* Attach and enable, or detach and disable */
+ /* Attach and enable, or detach and disable. Enabling and disabling GPIO
+ * interrupts is a multi-step process so the safest thing is to keep
+ * interrupts disabled during the reconfiguratino.
+ */
- ivdbg("IRQ:%d enable:%d\n", STM32_IRQ_EXTI2, enable);
+ flags = irqsave();
if (enable)
{
/* Configure the EXTI interrupt using the SAVED handler */
@@ -237,6 +243,7 @@ static void stmpe11_enable(FAR struct stmpe11_config_s *state, bool enable)
(void)stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, NULL);
}
+ irqrestore(flags);
}
static void stmpe11_clear(FAR struct stmpe11_config_s *state)