From 494dfe2ae6157348956b941eb7a1f57b66181a56 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Mar 2015 15:00:23 -0600 Subject: 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. --- apps/examples/adc/Kconfig | 2 +- apps/examples/adc/adc.h | 11 ----------- apps/examples/adc/adc_main.c | 7 ++++--- 3 files changed, 5 insertions(+), 15 deletions(-) (limited to 'apps') 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 * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -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; } -- cgit v1.2.3