smart-leds-rs / ws2812-spi-rs

Use ws2812 on rust with embedded-hal spi
Apache License 2.0
64 stars 23 forks source link

Change order of spi send and read #11

Closed abjorck closed 3 years ago

abjorck commented 3 years ago

Hey

I had trouble using SPI with my strip, constantly getting Overrun errors after a first successful write. After som trial and error guesswork, I made it work with the following changes to the lib.

Maybe it needs a config flag if it works differently for other hardware.. (I'm using stm32f4xx_hal on a STM32F401CEUx, the strip is just called "ws2812b led strip" (from "BTF-lighting"))

david-sawatzke commented 3 years ago

Hi, could you try if #12 works for you? Under the hood it should accomplish the same things as this PR, while being simpler

abjorck commented 3 years ago

Hey. The Overrun is gone, but it turned all leds white (except the first one slightly magenta?), whatever I send.

david-sawatzke commented 3 years ago

@abjorck I switched to a different approach, it now works for me on the stm32f1 which has a similar spi peripheral. Could you test it again?

abjorck commented 3 years ago

yes! that does it :) thanks