Skip to content

Commit 395d4d6

Browse files
Jason2866Staars
andauthored
Neopixel RMT (IDF 5.1) now supports more pixels (#19351)
* Initial C6 support * add C6 in tasmota_globals.h * fix copy&paste errors * Use updated platform (build 1481) * use common safeboot flags (#19282) (#352) Co-authored-by: Christian Baars <[email protected]> * use env var lib_ignore * safeboot lib_ignore env * revert wrong change * rm eink lib from standard used libs * add c2-board 4M, maximum_size probably a bit off * diffuse idea for 2MB with OTA and FS * C2 and C6 additions * C2 and C6 additions for commands.ino * C2 and C6 additions for crash recorder * C2 to support_esp * some preps for C2 * add c2 to tasmota.h * fix some typos and compile bugs * fix 2 compiler warnings for Arduino 3.0 * fix another warning * add correct pins to template * pins for C2, maximum_size updated * unclutter env:tasmota32c2-safeboot * fix c6 env * more pins for the C2, but not all * pin 9 and 10 for c2/c6 * add || * prep pins for c6 * make c6 compile, needs testing * fix copy-paste-error * more correct pin support C6 * pin14 C6 * wrong warning for C6 * 10 and 11 are flash pins on the C6 * boolean voodoo * fix EVERYTHING * fix Onewire for Arduino 3.0 * enable OneWire * finale fix for all platforms: OneWire.h * better compatibility * final fix onewire * refactor Platformio Arduino 3.0 setup * overlooked needed `;` * refactor as requested * fix NeoPixelBus compilation for C2 and C6 * fix Arduino30 for old working NeoPixel boards * Try to switch of RMT LED when not SOC supported * use latest IDF 5.1 * framework includes now "libsodium" * prep NeoPixel RMT rewrite * NeoPixel for C6 * fix Arduino 2.x * really fix compile ?? * fix compiler warning TSL2591 * fix compiler warning TSL2591 _2 * fix compile warning TSL2561 * fix warning sensirion part 1 * fix ESP32 Arduino 3.0 compile (needs work check) * Disable NeoPixel for C2 (no RMT support) * forgotten to remove * fix compiler warning * prep 5.1, TasUpdater * prep 5.1 SensirionRXFrame * prep 5.1, SensiriomI2CCommunication.cpp * prep5.1, last batch Sensirion * prep5.1, silence compiler warning * Silence C++ deprecated warning * Align with branch C6-support (#359) * prep5.1, fix berry_wire * revert deprecated compiler flag --------- Co-authored-by: Staars <[email protected]> Co-authored-by: Christian Baars <[email protected]> * add i2c #defines * enable more libs for ESP32 * refactor for esp-nimble-cpp * add esp-nimble-cpp, needed for C2,C6 * fix dual use of IRAM_ATTR for i2sDmaISR * silence compiler warning with cast * prep5.1, new DAC API in Berry * more libs enabled * NimBLE changes * fix wrong build flag for MI * add NimBLE ignores * add MI to env * use latest framework with changed NimBLE * add libesp32_div to C2/C6 * fix env konfig for NimBLE * new esp-cpp-nimble for all * prep5.1, silence compiler warning around IRAM_ATR * prep5.1, i2s pre-work * add c2 to lib esp-nimble-cpp * prep5.1, intermediate refactoring * prep5.1, intermediate refactoring * fix chirp for IDF>5 * prep5.1, fix compilation error * Update platformio_tasmota_core3_env.ini * prep5.1, SPI fixes for C2/C6 * prep5.1, fix universal display * enable uDisplay * c3cdc display * add odroid env * rm obsolote option * rm BLE from c3cdc * fix SD Card (changed sdkconfig) * cdc env, lvgl to all builds * add cdc safeboot * use framework build 1504 * prep5.1., intermediate restart * forgot to save * prep5.1, we love static cast * latest framework build 1510 * fix xsns_74_lmt01 * ditch NeoPixel-I2S for 5.1 * prep5.1, begin RMT C6 * Ethernet Test * forgot to upload * invert timing in led-encoder * build 1511 / IDF 5.1.0.230818 * compile NeopixelBus for C6 * re - uncomment * re - uncomment the next * enable Neopixel * One more Neopixel try * what a stupid typo * refac Pio Arduino 3.0 setup * updates ini's * disable by default core 32 Arduino 3.0 * disable uDisplay for S3 * Update tasmota_configurations_ESP32.h * fix s3 compile * we need a new RMT LED driver for 5.1 for all SOC's * Todo: port udl for S3 * turn on NeoPixel again, as it does not crash anymore * first partly working version * Arduino 3.0 pio config to ignore * gitignore for override Arduino 3.0 * Delete platformio_tasmota_core3_env.ini * Create platformio_tasmota_core3_env.ini * Delete platformio_tasmota_core3_env.ini * use more than pixel * deactivate Addlog storm * add platformio_tasmota_core3_env.ini to gitignore --------- Co-authored-by: Christian Baars <[email protected]> Co-authored-by: Christian Baars <[email protected]>
1 parent 996a1c2 commit 395d4d6

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Diff for: lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Esp32-hal-rmt.c
4545

4646
#include <Arduino.h>
4747

48-
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
48+
// extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
4949

5050
extern "C"
5151
{
@@ -55,6 +55,8 @@ extern "C"
5555
#include "esp_check.h"
5656
}
5757

58+
#define RMT_LED_STRIP_RESOLUTION_HZ 10000000 // 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
59+
5860
typedef struct {
5961
uint32_t resolution; /*!< Encoder resolution, in Hz */
6062
} led_strip_encoder_config_t;
@@ -122,7 +124,7 @@ static esp_err_t rmt_led_strip_encoder_reset(rmt_encoder_t *encoder)
122124
return ESP_OK;
123125
}
124126

125-
esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder)
127+
esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder/*, uint32_t bit0, uint32_t bit1*/)
126128
{
127129
const char* TAG = "TEST_RMT";
128130
esp_err_t ret = ESP_OK;
@@ -161,7 +163,7 @@ esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rm
161163
*ret_encoder = &led_encoder->base;
162164
return ret;
163165
err:
164-
AddLog(2,"RMT:could not init led decoder");
166+
// AddLog(2,"RMT:could not init led decoder");
165167
if (led_encoder) {
166168
if (led_encoder->bytes_encoder) {
167169
rmt_del_encoder(led_encoder->bytes_encoder);
@@ -232,8 +234,8 @@ class NeoEsp32RmtSpeedWs2811 : public NeoEsp32RmtSpeedBase
232234
class NeoEsp32RmtSpeedWs2812x : public NeoEsp32RmtSpeedBase
233235
{
234236
public:
235-
const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(400, 850);
236-
const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(800, 450);
237+
const uint32_t RmtBit0 = Item32Val(400, 850);
238+
const uint32_t RmtBit1 = Item32Val(800, 450);
237239
const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(300000); // 300us
238240
};
239241

@@ -512,9 +514,7 @@ template<typename T_SPEED, typename T_CHANNEL> class NeoEsp32RmtMethodBase
512514

513515
void Initialize()
514516
{
515-
#define RMT_LED_STRIP_RESOLUTION_HZ 10000000 // 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
516517
esp_err_t ret = ESP_OK;
517-
// rmt_channel_handle_t tx_chan = NULL;
518518
rmt_tx_channel_config_t config = {};
519519
config.clk_src = RMT_CLK_SRC_DEFAULT;
520520
config.gpio_num = static_cast<gpio_num_t>(_pin);
@@ -534,24 +534,24 @@ template<typename T_SPEED, typename T_CHANNEL> class NeoEsp32RmtMethodBase
534534

535535
// ESP_LOGI(TAG, "Enable RMT TX channel");
536536
ret += rmt_enable(_channel.RmtChannelNumber);
537-
AddLog(2,"RMT:initialized with error code: %u on pin: %u",ret, _pin);
537+
// AddLog(2,"RMT:initialized with error code: %u on pin: %u",ret, _pin);
538538
}
539539

540540
void Update(bool maintainBufferConsistency)
541541
{
542-
AddLog(2,"..");
542+
// AddLog(2,"..");
543543
// wait for not actively sending data
544544
// this will time out at 10 seconds, an arbitrarily long period of time
545545
// and do nothing if this happens
546546

547547
if (ESP_OK == ESP_ERROR_CHECK_WITHOUT_ABORT(rmt_tx_wait_all_done(_channel.RmtChannelNumber, 10000 / portTICK_PERIOD_MS)))
548548
{
549-
AddLog(2,"__ %u", _sizeData);
549+
// AddLog(2,"__ %u", _sizeData);
550550
// now start the RMT transmit with the editing buffer before we swap
551551
// const uint8_t pixels[3] = {100,100,100};
552-
esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, _dataEditing, 3, &_tx_config); // 3 for _sizeData
552+
esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, _dataEditing, _sizeData, &_tx_config); // 3 for _sizeData
553553
// esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, pixels, 3, &_tx_config);
554-
AddLog(2,"rmt_transmit: %u", ret);
554+
// AddLog(2,"rmt_transmit: %u", ret);
555555
if (maintainBufferConsistency)
556556
{
557557
// copy editing to sending,
@@ -596,7 +596,7 @@ template<typename T_SPEED, typename T_CHANNEL> class NeoEsp32RmtMethodBase
596596

597597
void construct()
598598
{
599-
AddLog(2,"RMT:construct");
599+
// AddLog(2,"RMT:construct");
600600
_dataEditing = static_cast<uint8_t*>(malloc(_sizeData));
601601
// data cleared later in Begin()
602602

0 commit comments

Comments
 (0)