periph / devices

Go·Hardware·Lean - Device drivers
https://periph.io
Apache License 2.0
83 stars 37 forks source link

nrzled.NewSPI: also add padding in the front #48

Closed flokli closed 2 years ago

flokli commented 2 years ago

Some SPI devices take a while to set up for transfer, and while doing so, show the first bit they're about to send.

This causes the first LED to always interpret the first symbol as a logical 1. Zapping out the whole strip will leave the first LED green, and the first pixel will always be slightly green-ish:

image

Prevent this, by applying the same 3 bit padding we have at the end to the front:

image

flokli commented 2 years ago

Test failures seem unrelated:

Run gosec -include=G104 -fmt=golint -quiet ./... 2022/05/14 12:15:59 internal error: package "errors" without types was imported from "command-line-arguments" Error: Process completed with exit code 1.

maruel commented 2 years ago

Thanks! Will take a look in ~half a day. CI failures look unrelated, will take a look separately.

maruel commented 2 years ago

Thanks! Will commit soon I just want to try a quick fix for the CI.

maruel commented 2 years ago

I fixed CI. I'll still squash since I can't run the checks on tip of tree.

maruel commented 2 years ago

https://github.com/periph/devices/actions/runs/2340193976 worked!

flokli commented 2 years ago

🎉

maruel commented 2 years ago

Released v3.6.14: https://github.com/periph/devices/releases/tag/v3.6.14

I was long overdue.

maruel commented 2 years ago

ugh, forgot to git fetch before tagging, let me create v3.6.15 :(