Skip to content

Commit

Permalink
Fixup RMT driver timing constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Apr 11, 2023
1 parent b67de7a commit 29cfb77
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/RmtDriver4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ esp_err_t RmtDriver::init() {
config.rmt_mode = RMT_MODE_TX;
config.clk_div = DIVIDER;
config.mem_block_num = 1;
//config.tx_config.idle_output_en = true;

return rmt_config(&config);
}
Expand Down
2 changes: 0 additions & 2 deletions src/RmtDriver5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#if SMARTLEDS_NEW_RMT_DRIVER
#include <cstddef>

#include <esp32/rom/ets_sys.h>

#include "SmartLeds.h"

namespace detail {
Expand Down
2 changes: 1 addition & 1 deletion src/RmtDriver5.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "Color.h"

#ifndef CONFIG_RMT_ISR_IRAM_SAFE
#if !defined(CONFIG_RMT_ISR_IRAM_SAFE) && !defined(SMARTLEDS_DISABLE_IRAM_WARNING)
#warning "Please enable CONFIG_RMT_ISR_IRAM_SAFE IDF option." \
"without it, the IDF driver is not able to supply data fast enough."
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/SmartLeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ using LedType = detail::TimingParams;
// Times are in nanoseconds,
// The RMT driver runs at 20MHz, so minimal representable time is 50 nanoseconds
static const LedType LED_WS2812 = { 350, 700, 800, 600, 50000 };
static const LedType LED_WS2812B = { 400, 800, 850, 450, 100000 };
// longer reset time because https://blog.adafruit.com/2017/05/03/psa-the-ws2812b-rgb-led-has-been-revised-will-require-code-tweak/
static const LedType LED_WS2812B = { 400, 800, 850, 450, 300000 }; // universal
static const LedType LED_WS2812B_NEWVARIANT = { 200, 750, 750, 200, 300000 };
static const LedType LED_WS2812B_OLDVARIANT = { 400, 800, 850, 450, 50000 };
// This is timing from datasheet, but does not seem to actually work - try LED_WS2812B
static const LedType LED_WS2812C = { 250, 550, 550, 250, 280000 };
static const LedType LED_SK6812 = { 300, 600, 900, 600, 80000 };
static const LedType LED_WS2813 = { 350, 800, 350, 350, 300000 };

Expand Down

0 comments on commit 29cfb77

Please sign in to comment.