diff options
author | Olivier Ortigues <o.ortigues@gmail.com> | 2016-10-18 22:43:43 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-07 17:13:49 +1100 |
commit | bc4441afa753176e1901017708d8a739c38806eb (patch) | |
tree | 8e61d4681a88038f7c3cf88fe2d1650ce9b29592 /esp8266 | |
parent | 8ebd53afc987e0ad21075d9c917020256f6d5b23 (diff) | |
download | micropython-bc4441afa753176e1901017708d8a739c38806eb.tar.gz micropython-bc4441afa753176e1901017708d8a739c38806eb.zip |
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.
Diffstat (limited to 'esp8266')
-rw-r--r-- | esp8266/espneopixel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/esp8266/espneopixel.c b/esp8266/espneopixel.c index 27c7731064..6c76591865 100644 --- a/esp8266/espneopixel.c +++ b/esp8266/espneopixel.c @@ -33,7 +33,7 @@ void /*ICACHE_RAM_ATTR*/ esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32 #ifdef NEO_KHZ400 if(is800KHz) { #endif - 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 |