drivers: pwm: shell: fix pwm_set calls
PWM has a single set function now, macros like PWM_USEC() can be used to specify other units than nanoseconds. This conversion was missed during API updates. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
61f2ed8356
commit
04836af2a9
1 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ static int cmd_usec(const struct shell *shell, size_t argc, char **argv)
|
|||
flags = strtoul(argv[args_indx.flags], NULL, 0);
|
||||
}
|
||||
|
||||
err = pwm_set_cycles_usec(dev, channel, period, pulse, flags);
|
||||
err = pwm_set(dev, channel, PWM_USEC(period), PWM_USEC(pulse), flags);
|
||||
if (err) {
|
||||
shell_error(shell, "failed to setup PWM (err %d)", err);
|
||||
return err;
|
||||
|
@ -117,7 +117,7 @@ static int cmd_nsec(const struct shell *shell, size_t argc, char **argv)
|
|||
flags = strtoul(argv[args_indx.flags], NULL, 0);
|
||||
}
|
||||
|
||||
err = pwm_set_cycles_nsec(dev, channel, period, pulse, flags);
|
||||
err = pwm_set(dev, channel, period, pulse, flags);
|
||||
if (err) {
|
||||
shell_error(shell, "failed to setup PWM (err %d)", err);
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue