From 3853080e4e43e903d012d5cda868e0f9989ff4fa Mon Sep 17 00:00:00 2001 From: Makuna Date: Thu, 30 Apr 2015 15:25:53 -0700 Subject: [PATCH] Tuned esp8266 timing tuned using logic analyser --- NeoPixelBus.cpp | 16 ++++++++-------- NeoPixelBus.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/NeoPixelBus.cpp b/NeoPixelBus.cpp index 43a5e1d..cd67645 100644 --- a/NeoPixelBus.cpp +++ b/NeoPixelBus.cpp @@ -76,28 +76,28 @@ void NeoPixelBus::Begin(void) #if defined(ESP8266) #pragma optimize( "", off ) -void send_ws_0_800(uint8_t gpio) { +void send_ws_0_800(uint8_t gpio) { uint8_t i; i = 4; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); - i = 9; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); + i = 6; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); } -void send_ws_1_800(uint8_t gpio) { +void send_ws_1_800(uint8_t gpio) { uint8_t i; - i = 8; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); - i = 5; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); + i = 9; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); + i = 2; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); } void send_ws_0_400(uint8_t gpio) { uint8_t i; i = 8; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); - i = 17; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); + i = 12; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); } void send_ws_1_400(uint8_t gpio) { uint8_t i; - i = 16; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); - i = 9; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); + i = 18; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, 1 << gpio); + i = 4; while (i--) GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, 1 << gpio); } #pragma optimize( "", on ) #endif diff --git a/NeoPixelBus.h b/NeoPixelBus.h index d4697d7..8a75af5 100644 --- a/NeoPixelBus.h +++ b/NeoPixelBus.h @@ -39,7 +39,7 @@ License along with NeoPixel. If not, see // v1 NeoPixels aren't handled by default, include the following define before the // NeoPixelBus library include to support the slower bus speeds -// #define INCLUDE_NEO_KHZ400_SUPPORT +//#define INCLUDE_NEO_KHZ400_SUPPORT class NeoPixelBus {