From 9e3c18cfd114ffd892ead66460e9bc040904c25d Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Dec 2011 21:55:54 +0000 Subject: 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 --- apps/examples/adc/adc_main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'apps/examples/adc/adc_main.c') 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", -- cgit v1.2.3