From 503c7e3d7b3eeea11dd803efcab0616596738296 Mon Sep 17 00:00:00 2001 From: Makuna Date: Thu, 28 May 2015 11:22:05 -0700 Subject: [PATCH] FirstPixelBitCleanup The first bit on some esp8266 will get elongated, this change has shown to cause this to be fixed. --- NeoPixelBus.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NeoPixelBus.cpp b/NeoPixelBus.cpp index 7871e47..13c01b2 100644 --- a/NeoPixelBus.cpp +++ b/NeoPixelBus.cpp @@ -90,6 +90,9 @@ static inline void send_pixels_800(uint8_t* pixels, uint8_t* end, uint8_t pin) uint8_t subpix; uint32_t cyclesStart; + // this set low will help cleanup the first bit + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); + cyclesStart = ESP.getCycleCount() + CYCLES_800; while (pixels < end) { @@ -140,6 +143,9 @@ static inline void send_pixels_400(uint8_t* pixels, uint8_t* end, uint8_t pin) uint8_t subpix; uint32_t cyclesStart; + // this set low will help cleanup the first bit + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); + cyclesStart = ESP.getCycleCount() + CYCLES_400; while (pixels < end) {