summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-04-01 22:00:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-04-01 22:00:37 +0000
commit87590afa9ca772243c261e6c1b8478565bd2771a (patch)
treed7a3161c5dea29510630f239e027dc32bac968fc /apps
parentf7122813d51018e5d3460a30596d2320a08ef740 (diff)
downloadpx4-nuttx-87590afa9ca772243c261e6c1b8478565bd2771a.tar.gz
px4-nuttx-87590afa9ca772243c261e6c1b8478565bd2771a.tar.bz2
px4-nuttx-87590afa9ca772243c261e6c1b8478565bd2771a.zip
More naming changes associated with earlier renaming of LP17xx up_spiinitialize; LPC178x SSP support; Open1788 SSP and touchscreen support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5811 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps')
-rw-r--r--apps/examples/README.txt7
-rw-r--r--apps/examples/touchscreen/Kconfig35
-rw-r--r--apps/examples/touchscreen/tc.h11
-rw-r--r--apps/examples/touchscreen/tc_main.c6
4 files changed, 48 insertions, 11 deletions
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index ff22580d0..fe16ada85 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -1509,7 +1509,7 @@ examples/touchscreen
CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN - Build the touchscreen test as
an NSH built-in function. Default: Built as a standalone problem
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
- correspnds to touchscreen device /dev/input0. Note this value must
+ corresponds to touchscreen device /dev/input0. Note this value must
with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH - The path to the touchscreen
device. This must be consistent with CONFIG_EXAMPLES_TOUCHSCREEN_MINOR.
@@ -1523,13 +1523,12 @@ examples/touchscreen
The following additional configurations must be set in the NuttX
configuration file:
- CONFIG_INPUTP=y
+ CONFIG_INPUT=y
(Plus any touchscreen-specific settings).
The following must also be defined in your apps configuration file:
- CONFIGURED_APPS += examples/tiff
- CONFIGURED_APPS += graphics/tiff
+ CONFIGURED_APPS += examples/touchscreen
The board-specific logic must provide the following interfaces that will
be called by the example in order to initialize and uninitialize the
diff --git a/apps/examples/touchscreen/Kconfig b/apps/examples/touchscreen/Kconfig
index e8d8728d8..18ece4923 100644
--- a/apps/examples/touchscreen/Kconfig
+++ b/apps/examples/touchscreen/Kconfig
@@ -10,4 +10,39 @@ config EXAMPLES_TOUCHSCREEN
Enable the touchscreen example
if EXAMPLES_TOUCHSCREEN
+
+config EXAMPLES_TOUCHSCREEN_BUILTIN
+ bool "NSH built-in application"
+ default y
+ depends on NSH_BUILTIN_APPS
+ ---help---
+ Build the touchscreen test as an NSH built-in function. Default:
+ Built as a standalone problem unless NSH_BUILTIN_APPS is defined.
+ Then the default is to build as an NSH built-in application.
+
+config EXAMPLES_TOUCHSCREEN_MINOR
+ int "Touchscreen minor device number"
+ default 0
+ ---help---
+ The minor device number. Minor=N corresponds to touchscreen device
+ /dev/input0. Note this value must with EXAMPLES_TOUCHSCREEN_DEVPATH.
+ Default 0.
+
+config EXAMPLES_TOUCHSCREEN_DEVPATH
+ string "Touchscreen device path"
+ default "/dev/input0"
+ ---help---
+ The path to the touchscreen device. This must be consistent with
+ EXAMPLES_TOUCHSCREEN_MINOR. Default: "/dev/input0"
+
+config EXAMPLES_TOUCHSCREEN_NSAMPLES
+ int "Number of samples"
+ default 0
+ depends on !EXAMPLES_TOUCHSCREEN_BUILTIN
+ ---help---
+ If EXAMPLES_TOUCHSCREEN_BUILTIN is defined, then the number of
+ samples is provided on the command line and this value is ignored.
+ Otherwise, this number of samples is collected and the program
+ terminates. Default: Zero (Samples are collected indefinitely).
+
endif
diff --git a/apps/examples/touchscreen/tc.h b/apps/examples/touchscreen/tc.h
index dddff11c3..055353ddd 100644
--- a/apps/examples/touchscreen/tc.h
+++ b/apps/examples/touchscreen/tc.h
@@ -42,7 +42,6 @@
#include <nuttx/config.h>
-
/****************************************************************************
* Definitions
****************************************************************************/
@@ -50,7 +49,7 @@
/* CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN - Build the touchscreen test as
* an NSH built-in function. Default: Built as a standalone problem
* CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
- * correspnds to touchscreen device /dev/input0. Note this value must
+ * corresponds to touchscreen device /dev/input0. Note this value must
* with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
* CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH - The path to the touchscreen
* device. This must be consistent with CONFIG_EXAMPLES_TOUCHSCREEN_MINOR.
@@ -58,8 +57,8 @@
* CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES - If CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN
* is defined, then the number of samples is provided on the command line
* and this value is ignored. Otherwise, this number of samples is
- * collected and the program terminates. Default: Samples are collected
- * indefinitely.
+ * collected and the program terminates. Default: Zero (Samples are collected
+ * indefinitely).
*/
#ifndef CONFIG_INPUT
@@ -78,6 +77,10 @@
# define CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH "/dev/input0"
#endif
+#ifndef CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES
+# define CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES 0
+#endif
+
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c
index 79b6b65a3..d49902612 100644
--- a/apps/examples/touchscreen/tc_main.c
+++ b/apps/examples/touchscreen/tc_main.c
@@ -88,7 +88,7 @@ int tc_main(int argc, char *argv[])
{
struct touch_sample_s sample;
ssize_t nbytes;
-#if defined(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN) || defined(CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES)
+#if defined(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN) || CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES > 0
long nsamples;
#endif
int fd;
@@ -106,7 +106,7 @@ int tc_main(int argc, char *argv[])
nsamples = strtol(argv[1], NULL, 10);
}
message("tc_main: nsamples: %d\n", nsamples);
-#elif defined(CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES)
+#elif CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES > 0
message("tc_main: nsamples: %d\n", CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES);
#endif
@@ -141,7 +141,7 @@ int tc_main(int argc, char *argv[])
#if defined(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN)
for (; nsamples > 0; nsamples--)
-#elif defined(CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES)
+#elif CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES > 0
for (nsamples = 0; nsamples < CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES; nsamples++)
#else
for (;;)