diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-30 17:28:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-30 17:28:22 +0000 |
commit | 7bdd1519eab1e0e79cbd84c941d4db6ecb7a8bae (patch) | |
tree | 8778d0026598a80e9eb7762d5618af6a6a7836c6 /apps/examples | |
parent | eaf142837ca2b85afa7037292dc5a08c34ff8367 (diff) | |
download | nuttx-7bdd1519eab1e0e79cbd84c941d4db6ecb7a8bae.tar.gz nuttx-7bdd1519eab1e0e79cbd84c941d4db6ecb7a8bae.tar.bz2 nuttx-7bdd1519eab1e0e79cbd84c941d4db6ecb7a8bae.zip |
Fix an error when the touchscreen test is run as an NSH built-in
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4002 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/touchscreen/tc_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c index 00e1fbab0..2d8fca033 100644 --- a/apps/examples/touchscreen/tc_main.c +++ b/apps/examples/touchscreen/tc_main.c @@ -42,6 +42,7 @@ #include <sys/types.h> #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> @@ -106,12 +107,15 @@ int MAIN_NAME(int argc, char *argv[]) * samples that we collect before returning. Otherwise, we never return */ -#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN +#if defined(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN) nsamples = 1; if (argc > 1) { - nsamples = strtol(argv[1]); + nsamples = strtol(argv[1], NULL, 10); } + message(MAIN_STRING "nsamples: %d\n", nsamples); +#elif defined(CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES) + message(MAIN_STRING "nsamples: %d\n", CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES); #endif /* Initialization of the touchscreen hardware is performed by logic |