rp-rs/ws2812-pio-rs

`nop` with delay `T2 - 2` instead of `T2 - 1`?

luiswirth opened this issue · 1 comments

Why does the nop have a delay of T2 - 2 instead of T2 - 1?

https://github.com/ithinuel/ws2812-pio-rs/blob/37ade6dd937c62c2b9c0b0fe212c291fe5f33317/src/lib.rs#L107

Usually it's T - 1 because the instruction itself uses a cycle and then you want to wait T - 1 more cycles.

The offical raspberry pi pio ws2812 example also uses T2 - 1.

https://github.com/raspberrypi/pico-examples/blob/afd1d2008f3fb3fa7a837dd1bdf17a6fecbc57fe/pio/ws2812/ws2812.pio#L25

It is likely a typo. You're welcome to open a PR to fix that :)