This is an automated email from the ASF dual-hosted git repository. aguettouche pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 37c8e5486cd75f4519c5333682e3b353bf872990 Author: Diego Herranz <diegoherr...@diegoherranz.com> AuthorDate: Sun Nov 29 19:42:38 2020 +0000 examples/pwm: fix help message - Fix bug for multiple PWM outputs (CONFIG_PWM_MULTICHAN). Wrong define was in use and only the information about the first channel was shown. - Fix formatting (a few line breaks and spaces missing). --- examples/pwm/pwm_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/pwm/pwm_main.c b/examples/pwm/pwm_main.c index dc1368a..7423616 100644 --- a/examples/pwm/pwm_main.c +++ b/examples/pwm/pwm_main.c @@ -192,30 +192,32 @@ static void pwm_help(FAR struct pwm_state_s *pwm) printf(" [[-c channel1] [[-c channel2] ...]] " "selects the channel number for each channel. "); printf("Default:"); - for (i = 0; i < CONFIG_PWM_MULTICHAN; i++) + for (i = 0; i < CONFIG_PWM_NCHANNELS; i++) { printf(" %d", channels[i]); } - printf("Current:"); - for (i = 0; i < CONFIG_PWM_MULTICHAN; i++) + printf(" Current:"); + for (i = 0; i < CONFIG_PWM_NCHANNELS; i++) { printf(" %d", pwm->channels[i]); } + printf("\n"); printf(" [[-d duty1] [[-d duty2] ...]] " "selects the pulse duty as a percentage. "); printf("Default:"); - for (i = 0; i < CONFIG_PWM_MULTICHAN; i++) + for (i = 0; i < CONFIG_PWM_NCHANNELS; i++) { printf(" %d %%", duties[i]); } - printf("Current:"); - for (i = 0; i < CONFIG_PWM_MULTICHAN; i++) + printf(" Current:"); + for (i = 0; i < CONFIG_PWM_NCHANNELS; i++) { printf(" %d %%", pwm->duties[i]); } + printf("\n"); #else printf(" [-d duty] selects the pulse duty as a percentage. " "Default: %d %% Current: %d %%\n",