rp2040: pwm: Fix errors at CONFIG_PWM_NCHANNELS=1
Perhaps it has never been tested with CONFIG_PWM_NCHANNELS=1. Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
This commit is contained in:
parent
4e89313913
commit
c076cb1bef
|
@ -276,6 +276,7 @@ if PWM_MULTICHAN
|
|||
config PWM_NCHANNELS
|
||||
int "Number of channels"
|
||||
default 2
|
||||
range 1 2
|
||||
---help---
|
||||
If the number of channels is set to 1, the generated code will
|
||||
only support the A channel of the PWM slices. This is functionally
|
||||
|
|
|
@ -288,8 +288,8 @@ int pwm_shutdown (struct pwm_lowerhalf_s * dev)
|
|||
|
||||
if (priv->pin >= 0)
|
||||
{
|
||||
rp2040_gpio_setdir(priv->pin[0], true);
|
||||
rp2040_gpio_put(priv->pin[0],
|
||||
rp2040_gpio_setdir(priv->pin, true);
|
||||
rp2040_gpio_put(priv->pin,
|
||||
((priv->flags & RP2040_PWM_CSR_A_INV) != 0));
|
||||
rp2040_gpio_set_function(priv->pin, RP2040_GPIO_FUNC_SIO);
|
||||
}
|
||||
|
|
|
@ -58,11 +58,18 @@ int rp2040_pwmdev_initialize(int slice,
|
|||
int ret;
|
||||
struct rp2040_pwm_lowerhalf_s *pwm_lowerhalf;
|
||||
|
||||
#if defined(CONFIG_PWM_NCHANNELS) && CONFIG_PWM_NCHANNELS == 2
|
||||
pwminfo("Initializing /dev/pwm%d a %d b %d f 0x%08lX..\n",
|
||||
slice,
|
||||
pin_a,
|
||||
pin_b,
|
||||
flags);
|
||||
#else
|
||||
pwminfo("Initializing /dev/pwm%d %d 0x%08lX..\n",
|
||||
slice,
|
||||
pin,
|
||||
flags);
|
||||
#endif
|
||||
|
||||
/* Initialize spi device */
|
||||
|
||||
|
|
Loading…
Reference in New Issue