Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19422: drivers/ws281x: improve timing for ESP32x r=maribu a=gschorcht ### Contribution description This PR provides a small change which improves the timing for ESP32x SoCs. If overhead like the loop control or the calculation of the waiting times for the next bit are performed while waiting for the end of the LOW phase, the time required for such operations is included in the LOW phase. This makes both the LOW phase and the period more precise. According to the definitions ```c #define WS281X_T_DATA_NS (1250U) #define WS281X_T_DATA_ONE_NS (650U) #define WS281X_T_DATA_ZERO_NS (325U) ``` the following timing is used: | Parameter | Value | Master | this PR | |:-------------|------:|-------:|--------:| | 1-Bit Period | 1250 | 1820 | 1400 | | 1-Bit HIGH | 650 | 690 | 710 | | 1-Bit LOW | 600 | 1130 | 690 | | | | | | | 0-Bit Period | 1250 | 1880 | 1400 | | 0-Bit HIGH | 350 | 380 | 400 | | 0-Bit LOW | 900 | 1500 | 1000 | Timing with current master: ![ws281x_esp32_current](https://user-images.githubusercontent.com/31932013/227731227-44d7283f-6591-4e11-9b79-9c49b08c64a4.png) Timing with this PR: ![ws281x_esp32_improved](https://user-images.githubusercontent.com/31932013/227731250-22819d1a-524c-43db-ab73-1bbb34cddee3.png) ### Testing procedure `tests/driver_ws281x` should still work. ### Issues/PRs references Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
- Loading branch information