diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-05 18:30:39 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-05 18:30:39 -0600 |
commit | ee4c5214f959943c196dbeaaab9ed038f4dbd0f1 (patch) | |
tree | ac7e68488a79a92f621005461db87d62eb57d8d8 /apps | |
parent | 26b761fcac72cb7b46740b5a92fd8ff27eb947b7 (diff) | |
download | nuttx-ee4c5214f959943c196dbeaaab9ed038f4dbd0f1.tar.gz nuttx-ee4c5214f959943c196dbeaaab9ed038f4dbd0f1.tar.bz2 nuttx-ee4c5214f959943c196dbeaaab9ed038f4dbd0f1.zip |
apps/examples/pwm: Clean up some configuration confusion
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ChangeLog.txt | 2 | ||||
-rw-r--r-- | apps/examples/README.txt | 4 | ||||
-rw-r--r-- | apps/examples/pwm/Kconfig | 12 | ||||
-rw-r--r-- | apps/examples/pwm/pwm.h | 4 | ||||
-rw-r--r-- | apps/examples/pwm/pwm_main.c | 8 |
5 files changed, 16 insertions, 14 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 9bf2dff1e..72db3df36 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -625,5 +625,5 @@ Includes the test to verify the CC3000 (2013-9-3). * apps/examples/usbmsc: apps/examples/usbstorage renamed usbmsc. Change submitted by CCTSAO (2013-6-5). - + * apps/examples/pwm: Clean-up some configuration confusion (2013-9-5). diff --git a/apps/examples/README.txt b/apps/examples/README.txt index b8c270419..bb0c9fc49 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -1380,8 +1380,8 @@ examples/pwm specific PWM settings might require additional settings). CONFIG_PWM - Enables PWM support. - CONFIG_EXAMPLES_PWM_COUNT - Enabled PWM pulse count support (if the - hardware supports it). + CONFIG_PWM_PULSECOUNT - Enables PWM pulse count support (if the hardware + supports it). CONFIG_NSH_BUILTIN_APPS - Build the PWM test as an NSH built-in function. Default: Not built! The example can only be used as an NSH built-in application diff --git a/apps/examples/pwm/Kconfig b/apps/examples/pwm/Kconfig index b9b28fd79..94dc6fb7a 100644 --- a/apps/examples/pwm/Kconfig +++ b/apps/examples/pwm/Kconfig @@ -32,17 +32,19 @@ config EXAMPLES_PWM_DUTYPCT config EXAMPLES_PWM_DURATION int "Default PWM duration" - default 5 if !EXAMPLES_PWM_PULSECOUNT + default 5 ---help--- The default PWM pulse train duration in seconds. Used only if the current - pulse count is zero (pulse countis only supported if PWM_PULSECOUNT - is defined). Default: 5 seconds + pulse count is zero (pulse count is only supported if PWM_PULSECOUNT + is not defined). Default: 5 seconds config EXAMPLES_PWM_PULSECOUNT int "Default pulse count" default 0 + depends on PWM_PULSECOUNT ---help--- - The initial PWM pulse count. This option is only available if PWM_PULSECOUNT - is nonzero. Default: 0 (i.e., use the duration, not the count). + The initial PWM pulse count. This option is only available if + PWM_PULSECOUNT is defined. Default: 0 (i.e., use the duration, not + the count). endif diff --git a/apps/examples/pwm/pwm.h b/apps/examples/pwm/pwm.h index a6132ca8b..db59bb051 100644 --- a/apps/examples/pwm/pwm.h +++ b/apps/examples/pwm/pwm.h @@ -84,8 +84,8 @@ # define CONFIG_EXAMPLES_PWM_DURATION 5 #endif -#ifndef CONFIG_EXAMPLES_PWM_COUNT -# define CONFIG_EXAMPLES_PWM_COUNT 0 +#ifndef CONFIG_EXAMPLES_PWM_PULSECOUNT +# define CONFIG_EXAMPLES_PWM_PULSECOUNT 0 #endif /* Debug ********************************************************************/ diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c index a46c10f55..447daf7d9 100644 --- a/apps/examples/pwm/pwm_main.c +++ b/apps/examples/pwm/pwm_main.c @@ -123,16 +123,16 @@ static void pwm_help(FAR struct pwm_state_s *pwm) message(" [-p devpath] selects the PWM device. " "Default: %s Current: %s\n", CONFIG_EXAMPLES_PWM_DEVPATH, pwm->devpath ? pwm->devpath : "NONE"); - message(" [-f addr] selects the pulse frequency. " + message(" [-f frequency] selects the pulse frequency. " "Default: %d Hz Current: %d Hz\n", CONFIG_EXAMPLES_PWM_FREQUENCY, pwm->freq); - message(" [-d duty] selcts the pulse duty as a percentage. " + message(" [-d duty] selects the pulse duty as a percentage. " "Default: %d %% Current: %d %%\n", CONFIG_EXAMPLES_PWM_DUTYPCT, pwm->duty); #ifdef CONFIG_PWM_PULSECOUNT message(" [-n count] selects the pulse count. " "Default: %d Current: %d\n", - CONFIG_EXAMPLES_PWM_COUNT, pwm->count); + CONFIG_EXAMPLES_PWM_PULSECOUNT, pwm->count); #endif message(" [-t duration] is the duration of the pulse train in seconds. " "Default: %d Current: %d\n", @@ -287,7 +287,7 @@ int pwm_main(int argc, char *argv[]) g_pwmstate.freq = CONFIG_EXAMPLES_PWM_FREQUENCY; g_pwmstate.duration = CONFIG_EXAMPLES_PWM_DURATION; #ifdef CONFIG_PWM_PULSECOUNT - g_pwmstate.count = CONFIG_EXAMPLES_PWM_COUNT; + g_pwmstate.count = CONFIG_EXAMPLES_PWM_PULSECOUNT; #endif g_pwmstate.initialized = true; } |