Commit bc4441af authored by Olivier Ortigues's avatar Olivier Ortigues Committed by Damien George
Browse files

esp8266/espneopixel.c: Solve glitching LED issues with cpu at 80MHz.

At the WS2812 driver level, a 400ns value was used for T0H (time high to
send a 0 bit) but LED specification says it should be 350ns +- 150ns.
Due to loop overhead the 400ns value could lead to T0H close to 500ns
which is too close from the limit value and gave glitches (bad data to
pixels) in some cases.  This patch makes the calculated T0H value 350ns.
parent 8ebd53af
......@@ -33,7 +33,7 @@ void /*ICACHE_RAM_ATTR*/ esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32
#ifdef NEO_KHZ400
if(is800KHz) {
time0 = fcpu / 2500000; // 0.4us
time0 = fcpu / 2857143; // 0.35us
time1 = fcpu / 1250000; // 0.8us
period = fcpu / 800000; // 1.25us per bit
#ifdef NEO_KHZ400
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment