drivers: pwm: rpi_pico: fix setting of cycle count per period
pwm_set_wrap() sets the TOP value, not the number of cycles. Counter will run from 0 to TOP inclusive, generating TOP + 1 cycles. To get n cycles, we need to set TOP to (n - 1). The wrong setting made it impossible to achieve 100 % duty cycle, as there was always one extra cycle. Fixes: 7e0fff24 ("drivers: pwm: add pwm driver for rpi_pico") Signed-off-by:Oliver Barta <o.barta89@gmail.com>
Loading
Please sign in to comment