diff --git a/examples/pwm/Kconfig b/examples/pwm/Kconfig index 94dc6fb7a..50672bb8f 100644 --- a/examples/pwm/Kconfig +++ b/examples/pwm/Kconfig @@ -6,7 +6,8 @@ config EXAMPLES_PWM bool "Pulse width modulation (PWM) example" default n - depends on PWM && NSH_BUILTIN_APPS + depends on PWM && NSH_BUILTIN_APPS && LIB_BOARDCTL + select BOARDCTL_PWMTEST ---help--- Enable the Pulse width modulation (PWM) example diff --git a/examples/pwm/pwm.h b/examples/pwm/pwm.h index c1c6820e8..e6703991a 100644 --- a/examples/pwm/pwm.h +++ b/examples/pwm/pwm.h @@ -100,15 +100,4 @@ * Public Function Prototypes ****************************************************************************/ -/**************************************************************************** - * Name: pwm_devinit() - * - * Description: - * Perform architecuture-specific initialization of the PWM hardware. This - * interface must be provided by all configurations using apps/examples/pwm - * - ****************************************************************************/ - -int pwm_devinit(void); - #endif /* __APPS_EXAMPLES_PWM_PWM_H */ diff --git a/examples/pwm/pwm_main.c b/examples/pwm/pwm_main.c index ba5687541..844551550 100644 --- a/examples/pwm/pwm_main.c +++ b/examples/pwm/pwm_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/pwm/pwm_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 @@ -313,10 +314,10 @@ int pwm_main(int argc, char *argv[]) * this test. */ - ret = pwm_devinit(); + ret = boardctl(BOARDIOC_PWMTEST_SETUP, 0); if (ret != OK) { - printf("pwm_main: pwm_devinit failed: %d\n", ret); + printf("pwm_main: boardctl failed: %d\n", ret); goto errout; }