Skip to content

Commit 65a2433

Browse files
committed
led_strip: fix stability for WS2812B
1 parent 933114d commit 65a2433

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- (led_strip) White component for RGBW strips now calculated automatically
2626
- (led_strip) Fixed bug in led_strip_set_pixels()
2727
- (led_strip) Added support for global brightness for ESP-IDF >= v4.4
28+
- (led_strip) Improved stability for WS2812B
2829
- (refactoring) Updated component makefiles and CMakeLists
2930
- (i2cdev) Added option to disable all mutexes
3031

components/led_strip/led_strip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ static const char *TAG = "led_strip";
6464

6565
#define LED_STRIP_RMT_CLK_DIV 2
6666

67-
#define WS2812_T0H_NS 350
67+
#define WS2812_T0H_NS 400
6868
#define WS2812_T0L_NS 1000
6969
#define WS2812_T1H_NS 1000
70-
#define WS2812_T1L_NS 350
70+
#define WS2812_T1L_NS 400
7171

7272
#define SK6812_T0H_NS 300
7373
#define SK6812_T0L_NS 900
@@ -113,7 +113,7 @@ static void IRAM_ATTR _rmt_adapter(const void *src, rmt_item32_t *dest, size_t s
113113
while (size < src_size && num < wanted_num)
114114
{
115115
#ifdef LED_STIRP_BRIGNTNESS
116-
uint8_t b = scale8_video(*psrc, brightness);
116+
uint8_t b = brightness != 255 ? scale8_video(*psrc, brightness) : *psrc;
117117
#else
118118
uint8_t b = *psrc;
119119
#endif

0 commit comments

Comments
 (0)