Skip to content

Commit c888d6a

Browse files
68ec020carlescufi
authored andcommitted
drivers: pwm: rpi_pico: Use “pico_channel” instead of “ch”
pwm_set_chan_level uses slice channels A(=0) or B(=1) and not Zephyr channel (0..15). So PWM doesn't work for channels > 1. There is already a function (pwm_rpi_channel_to_pico_channel) which does the right thing, but it isn't used for pwm_set_chan_level. Signed-off-by: Jan Hilsdorf <[email protected]>
1 parent 8ef75e2 commit c888d6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm_rpi_pico.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int pwm_rpi_set_cycles(const struct device *dev, uint32_t ch, uint32_t pe
113113
pwm_rpi_set_channel_polarity(dev, slice, pico_channel,
114114
(flags & PWM_POLARITY_MASK) == PWM_POLARITY_INVERTED);
115115
pwm_set_wrap(slice, period_cycles);
116-
pwm_set_chan_level(slice, ch, pulse_cycles);
116+
pwm_set_chan_level(slice, pico_channel, pulse_cycles);
117117

118118
return 0;
119119
};

0 commit comments

Comments
 (0)