From d0c91546343d545c11c10f7d29d1c06175c1109a Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 4 Oct 2012 17:36:07 +0000 Subject: Change all occurrences of CONFIG_EXAMPLE_ to CONFIG_EXAMPLES_ for consistency; fleshed out a few more Kconfig files git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5211 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/adc/adc_main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 4797265db..404fba8c1 100644 --- a/apps/examples/adc/adc_main.c +++ b/apps/examples/adc/adc_main.c @@ -57,6 +57,14 @@ * Pre-processor Definitions ****************************************************************************/ +/* Use CONFIG_EXAMPLES_ADC_NSAMPLES == 0 to mean to collect samples + * indefinitely. + */ + +#ifndef CONFIG_EXAMPLES_ADC_NSAMPLES +# define CONFIG_EXAMPLES_ADC_NSAMPLES 0 +#endif + /**************************************************************************** * Private Types ****************************************************************************/ @@ -249,7 +257,7 @@ int adc_main(int argc, char *argv[]) adc_devpath(&g_adcstate, CONFIG_EXAMPLES_ADC_DEVPATH); -#ifdef CONFIG_EXAMPLES_ADC_NSAMPLES +#if CONFIG_EXAMPLES_ADC_NSAMPLES > 0 g_adcstate.count = CONFIG_EXAMPLES_ADC_NSAMPLES; #else g_adcstate.count = 1; @@ -267,7 +275,7 @@ int adc_main(int argc, char *argv[]) * samples that we collect before returning. Otherwise, we never return */ -#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_ADC_NSAMPLES) +#if defined(CONFIG_NSH_BUILTIN_APPS) || CONFIG_EXAMPLES_ADC_NSAMPLES > 0 message("adc_main: g_adcstate.count: %d\n", g_adcstate.count); #endif @@ -290,7 +298,7 @@ int adc_main(int argc, char *argv[]) #if defined(CONFIG_NSH_BUILTIN_APPS) for (; g_adcstate.count > 0; g_adcstate.count--) -#elif defined(CONFIG_EXAMPLES_ADC_NSAMPLES) +#elif CONFIG_EXAMPLES_ADC_NSAMPLES > 0 for (g_adcstate.count = 0; g_adcstate.count < CONFIG_EXAMPLES_ADC_NSAMPLES; g_adcstate.count++) #else for (;;) -- cgit v1.2.3