diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h index a12db6481747..a7bfa3c7204f 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h @@ -45,7 +45,7 @@ Esp32-hal-rmt.c #include -extern void AddLog(uint32_t loglevel, PGM_P formatP, ...); +// extern void AddLog(uint32_t loglevel, PGM_P formatP, ...); extern "C" { @@ -55,6 +55,8 @@ extern "C" #include "esp_check.h" } +#define RMT_LED_STRIP_RESOLUTION_HZ 10000000 // 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution) + typedef struct { uint32_t resolution; /*!< Encoder resolution, in Hz */ } led_strip_encoder_config_t; @@ -122,7 +124,7 @@ static esp_err_t rmt_led_strip_encoder_reset(rmt_encoder_t *encoder) return ESP_OK; } -esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder) +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*/) { const char* TAG = "TEST_RMT"; 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 *ret_encoder = &led_encoder->base; return ret; err: - AddLog(2,"RMT:could not init led decoder"); + // AddLog(2,"RMT:could not init led decoder"); if (led_encoder) { if (led_encoder->bytes_encoder) { rmt_del_encoder(led_encoder->bytes_encoder); @@ -232,8 +234,8 @@ class NeoEsp32RmtSpeedWs2811 : public NeoEsp32RmtSpeedBase class NeoEsp32RmtSpeedWs2812x : public NeoEsp32RmtSpeedBase { public: - const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(400, 850); - const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(800, 450); + const uint32_t RmtBit0 = Item32Val(400, 850); + const uint32_t RmtBit1 = Item32Val(800, 450); const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(300000); // 300us }; @@ -512,9 +514,7 @@ template class NeoEsp32RmtMethodBase void Initialize() { -#define RMT_LED_STRIP_RESOLUTION_HZ 10000000 // 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution) esp_err_t ret = ESP_OK; - // rmt_channel_handle_t tx_chan = NULL; rmt_tx_channel_config_t config = {}; config.clk_src = RMT_CLK_SRC_DEFAULT; config.gpio_num = static_cast(_pin); @@ -534,24 +534,24 @@ template class NeoEsp32RmtMethodBase // ESP_LOGI(TAG, "Enable RMT TX channel"); ret += rmt_enable(_channel.RmtChannelNumber); - AddLog(2,"RMT:initialized with error code: %u on pin: %u",ret, _pin); + // AddLog(2,"RMT:initialized with error code: %u on pin: %u",ret, _pin); } void Update(bool maintainBufferConsistency) { - AddLog(2,".."); + // AddLog(2,".."); // wait for not actively sending data // this will time out at 10 seconds, an arbitrarily long period of time // and do nothing if this happens if (ESP_OK == ESP_ERROR_CHECK_WITHOUT_ABORT(rmt_tx_wait_all_done(_channel.RmtChannelNumber, 10000 / portTICK_PERIOD_MS))) { - AddLog(2,"__ %u", _sizeData); + // AddLog(2,"__ %u", _sizeData); // now start the RMT transmit with the editing buffer before we swap // const uint8_t pixels[3] = {100,100,100}; - esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, _dataEditing, 3, &_tx_config); // 3 for _sizeData + esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, _dataEditing, _sizeData, &_tx_config); // 3 for _sizeData // esp_err_t ret = rmt_transmit(_channel.RmtChannelNumber, _led_encoder, pixels, 3, &_tx_config); - AddLog(2,"rmt_transmit: %u", ret); + // AddLog(2,"rmt_transmit: %u", ret); if (maintainBufferConsistency) { // copy editing to sending, @@ -596,7 +596,7 @@ template class NeoEsp32RmtMethodBase void construct() { - AddLog(2,"RMT:construct"); + // AddLog(2,"RMT:construct"); _dataEditing = static_cast(malloc(_sizeData)); // data cleared later in Begin()