rpi-ws281x / rpi-ws281x-go

Go library wrapping for the rpi-ws281x library
Apache License 2.0
65 stars 15 forks source link

Prevent crash in SPI mode #3

Closed hermanbanken closed 5 years ago

hermanbanken commented 5 years ago

Fixes #2. spi_init does not init channel[1].leds so when the WS2811.Init() function accessed that array it would crash.

This PR fixes my problem, but it might not be how you want to release this. I don't know whether you could also check whether ledsArray == nil for example, but which might be cleaner.

hermanbanken commented 5 years ago

@supcik any update? This PR works (for me); I've tested it. Is there any reason not to merge this PR? It is just a sanity check that I've added.

Is not merging because you don't have time to test (understandable) or because the PR is fundamentally flawed? I'd like to know 😉

mtenberge commented 5 years ago

I can confirm that this change works for me too (also using SPI), and I would like to see it merged into master as well :+1:

supcik commented 5 years ago

Done. Thank you for your contribution.