mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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).
This commit is contained in:
parent
fe915679b1
commit
37c8e5486c
1 changed files with 8 additions and 6 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue