summaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-12-22 21:55:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-12-22 21:55:54 +0000
commit9e3c18cfd114ffd892ead66460e9bc040904c25d (patch)
treede611df330178a7c539127b3d7f26e5420094a7b /apps/examples
parenta8ab2aef243697e99a0c9eba0b9d9fba98444b27 (diff)
downloadnuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.tar.gz
nuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.tar.bz2
nuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.zip
Update to the STM32 ADC and CAN drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4215 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/adc/adc_main.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
index 2d5414410..39eaf7d26 100644
--- a/apps/examples/adc/adc_main.c
+++ b/apps/examples/adc/adc_main.c
@@ -98,7 +98,7 @@ int MAIN_NAME(int argc, char *argv[])
size_t readsize;
ssize_t nbytes;
#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
- long nsamples;
+ long nloops;
#endif
int fd;
int errval = 0;
@@ -110,14 +110,14 @@ int MAIN_NAME(int argc, char *argv[])
*/
#if defined(CONFIG_NSH_BUILTIN_APPS)
- nsamples = 1;
+ nloops = 1;
if (argc > 1)
{
- nsamples = strtol(argv[1], NULL, 10);
+ nloops = strtol(argv[1], NULL, 10);
}
- message(MAIN_STRING "nsamples: %d\n", nsamples);
+ message(MAIN_STRING "nloops: %d\n", nloops);
#elif defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
- message(MAIN_STRING "nsamples: %d\n", CONFIG_EXAMPLES_ADC_NSAMPLES);
+ message(MAIN_STRING "nloops: %d\n", CONFIG_EXAMPLES_ADC_NSAMPLES);
#endif
/* Initialization of the ADC hardware is performed by logic external to
@@ -150,9 +150,9 @@ int MAIN_NAME(int argc, char *argv[])
*/
#if defined(CONFIG_NSH_BUILTIN_APPS)
- for (; nsamples > 0; nsamples--)
+ for (; nloops > 0; nloops--)
#elif defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
- for (nsamples = 0; nsamples < CONFIG_EXAMPLES_ADC_NSAMPLES; nsamples++)
+ for (nloops = 0; nloops < CONFIG_EXAMPLES_ADC_NSAMPLES; nloops++)
#else
for (;;)
#endif
@@ -167,7 +167,6 @@ int MAIN_NAME(int argc, char *argv[])
readsize = CONFIG_EXAMPLES_ADC_GROUPSIZE * sizeof(struct adc_msg_s);
nbytes = read(fd, sample, readsize);
- message("Bytes read: %d\n", nbytes);
/* Handle unexpected return values */
@@ -201,7 +200,7 @@ int MAIN_NAME(int argc, char *argv[])
}
else
{
- message("Sample: ");
+ message("Sample:\n");
for (i = 0; i < nsamples ; i++)
{
message("%d: channel: %d value: %d\n",