Merged in paulpatience/nuttx-apps (pull request #17)

apps/examples/adc: Fix Kconfig file
This commit is contained in:
Gregory Nutt 2015-11-01 21:35:39 -06:00
commit 02620cff35
2 changed files with 8 additions and 6 deletions

View File

@ -6,7 +6,7 @@
config EXAMPLES_ADC config EXAMPLES_ADC
bool "ADC example" bool "ADC example"
default n default n
depends on ADC && LIB_BOARDCTL depends on ADC && BOARDCTL_ADCTEST
---help--- ---help---
Enable the ADC example Enable the ADC example

View File

@ -305,7 +305,9 @@ int adc_main(int argc, char *argv[])
#if defined(CONFIG_NSH_BUILTIN_APPS) #if defined(CONFIG_NSH_BUILTIN_APPS)
for (; g_adcstate.count > 0; g_adcstate.count--) for (; g_adcstate.count > 0; g_adcstate.count--)
#elif CONFIG_EXAMPLES_ADC_NSAMPLES > 0 #elif CONFIG_EXAMPLES_ADC_NSAMPLES > 0
for (g_adcstate.count = 0; g_adcstate.count < CONFIG_EXAMPLES_ADC_NSAMPLES; g_adcstate.count++) for (g_adcstate.count = 0;
g_adcstate.count < CONFIG_EXAMPLES_ADC_NSAMPLES;
g_adcstate.count++)
#else #else
for (;;) for (;;)
#endif #endif
@ -365,7 +367,7 @@ int adc_main(int argc, char *argv[])
else else
{ {
printf("Sample:\n"); printf("Sample:\n");
for (i = 0; i < nsamples ; i++) for (i = 0; i < nsamples; i++)
{ {
printf("%d: channel: %d value: %d\n", printf("%d: channel: %d value: %d\n",
i+1, sample[i].am_channel, sample[i].am_data); i+1, sample[i].am_channel, sample[i].am_data);