tonarino / panel-firmware

Firmware for the volume control hardware, targeting an STM32F4 board
MIT License
75 stars 10 forks source link

LED pulsing seems to be causing issues #15

Closed bschwind closed 3 years ago

bschwind commented 3 years ago

I think maybe this code is running too frequently and causing stability issues with the LED color:

https://github.com/tonarino/panel-firmware/blob/1ceeeb76d605f4c7d285d12a397c710f6a5972f3/src/main.rs#L190-L195

If I only set the colors when receiving an LED command, it works predictably, but if I just try to update the color without pulsing, it often doesn't change.

bschwind commented 3 years ago

I fixed this in #14 by making the flush() function take more time. I think our new volume dial PCBs might be using a newer version of the WS2812B LEDs. Some info on that here:

https://blog.particle.io/heads-up-ws2812b-neopixels-are-about-to-change/

  1. “Old & New chips are exactly the same as in Timing, Data transmission and Data structure. However, the Reset Time increased from >50us to >280us. It won’t cause wrong reset while interruption, and what’s more, it supports the lower frequency and inexpensive MCU. When the “Reset Time<280us”, don’t mixed up and kindly please make necessary amends.”