diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-11 18:27:46 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-11 18:27:46 +0000 |
commit | 186c49997038f34f2b3efd6fd9aa4fde8f4213e1 (patch) | |
tree | 77ec188ac358d775f36b3d77fde24509afe7fd26 /nuttx/configs | |
parent | a280d993608d0c40ad0b4efc8adcbf72f67d53a4 (diff) | |
download | px4-nuttx-186c49997038f34f2b3efd6fd9aa4fde8f4213e1.tar.gz px4-nuttx-186c49997038f34f2b3efd6fd9aa4fde8f4213e1.tar.bz2 px4-nuttx-186c49997038f34f2b3efd6fd9aa4fde8f4213e1.zip |
SMTPE11 and NxWM touchscreen fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4722 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/README.txt | 4 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/nsh/defconfig | 5 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/nxwm/defconfig | 5 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/src/up_stmpe11.c | 11 |
4 files changed, 20 insertions, 5 deletions
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index 6bd459801..15ff30e11 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -793,7 +793,9 @@ defconfig -- This is a configuration file similar to the Linux 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). diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig index 5f8945075..a0131c993 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 10ffa0879..3242948f3 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 e06e203e7..72482c92c 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) |