Crazy-Geeks / STM32-ARGB-DMA

STM32 Library for Addressable LEDs: WS2812(b), WS2811, SK6812, etc. Supports RGB & RGBW LEDs.
MIT License
84 stars 25 forks source link

Mvisnesky/led strip bad led color fix #11

Closed vism2889 closed 1 year ago

vism2889 commented 1 year ago

Description: Fixes incorrect color for the last LED on ws2812 LED strip.

Details: After checking contents of all buffers (LED, PWM, etc.), all contained the correct LED color channel data, despite that the incorrect color persisted. The last LED was not receiving the very last data byte containing the blue color channel. We believe this issue was timing related: the DMA transfer ended before all contents in the PWM buffer was transferred.

Solution: Added an extra empty byte to the PWM buffer to allow a slight bit of extra time for all the non-empty data to be transferred correctly. After testing this proved to remedy the bug without causing any other unexpected issues.