diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 15:00:23 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 15:00:23 -0600 |
commit | 494dfe2ae6157348956b941eb7a1f57b66181a56 (patch) | |
tree | 7201b16b309f34b73f46936ed1980c0ef0b8154a /apps | |
parent | 49a7570f92a3ae31838f2eea2fa71354361f2881 (diff) | |
download | px4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.tar.gz px4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.tar.bz2 px4-nuttx-494dfe2ae6157348956b941eb7a1f57b66181a56.zip |
Rename adc_devinit() to board_adc_setup(). Add support to the boardctl() interface so that it can call board_adc_setup() on behalf of an application. Change apps/examples/adc to that is now calls boardctl() instead of adc_devinit() in order to initalize the ADC device.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/examples/adc/Kconfig | 2 | ||||
-rw-r--r-- | apps/examples/adc/adc.h | 11 | ||||
-rw-r--r-- | apps/examples/adc/adc_main.c | 7 |
3 files changed, 5 insertions, 15 deletions
diff --git a/apps/examples/adc/Kconfig b/apps/examples/adc/Kconfig index 655427780..8f20f1a02 100644 --- a/apps/examples/adc/Kconfig +++ b/apps/examples/adc/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_ADC bool "ADC example" default n - depends on ADC + depends on ADC && LIB_BOARDCTL ---help--- Enable the ADC example diff --git a/apps/examples/adc/adc.h b/apps/examples/adc/adc.h index 291d485fa..84583ca8f 100644 --- a/apps/examples/adc/adc.h +++ b/apps/examples/adc/adc.h @@ -91,15 +91,4 @@ struct adc_state_s * Public Function Prototypes ****************************************************************************/ -/**************************************************************************** - * Name: adc_devinit() - * - * Description: - * Perform architecuture-specific initialization of the ADC hardware. This - * interface must be provided by all configurations using apps/examples/adc - * - ****************************************************************************/ - -int adc_devinit(void); - #endif /* __APPS_EXAMPLES_ADC_ADC_H */ diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c index 3478b5e0a..16f180696 100644 --- a/apps/examples/adc/adc_main.c +++ b/apps/examples/adc/adc_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/adc/adc_main.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ #include <sys/types.h> #include <sys/ioctl.h> +#include <sys/boardctl.h> #include <stdio.h> #include <stdlib.h> @@ -250,10 +251,10 @@ int adc_main(int argc, char *argv[]) */ printf("adc_main: Initializing external ADC device\n"); - ret = adc_devinit(); + ret = boardctl(BOARDIOC_ADCTEST_SETUP, 0); if (ret != OK) { - printf("adc_main: adc_devinit failed: %d\n", ret); + printf("adc_main: boardctl failed: %d\n", ret); errval = 1; goto errout; } |