We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 776d665 commit d98b3e2Copy full SHA for d98b3e2
1 file changed
drivers/pwm/pwm-pio-rp1.c
@@ -83,7 +83,7 @@ static inline void pwm_program_init(PIO pio, uint sm, uint offset, uint pin)
83
/* Write `period` to the input shift register - must be disabled */
84
static void pio_pwm_set_period(PIO pio, uint sm, uint32_t period)
85
{
86
- pio_sm_put_blocking(pio, sm, period);
+ pio_sm_put_blocking(pio, sm, period - 1);
87
pio_sm_exec(pio, sm, pio_encode_pull(false, false));
88
pio_sm_exec(pio, sm, pio_encode_out(pio_isr, 32));
89
}
0 commit comments