Skip to content
Commit e4fcb324 authored by Oliver Barta's avatar Oliver Barta Committed by Carles Cufí
Browse files

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: default avatarOliver Barta <o.barta89@gmail.com>
parent c17b102c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment