From ab6ae9341a4eab0466789f587afd1d1e6bf8284c Mon Sep 17 00:00:00 2001 From: morris Date: Wed, 24 May 2023 14:04:01 +0800 Subject: [PATCH] example: fix led strip memory overwrite before trans done Closes https://github.com/espressif/esp-idf/issues/11487 --- .../peripherals/rmt/led_strip/main/led_strip_example_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c b/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c index f29c32184d..65cb57e066 100644 --- a/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c +++ b/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c @@ -118,9 +118,11 @@ void app_main(void) } // Flush RGB values to LEDs ESP_ERROR_CHECK(rmt_transmit(led_chan, led_encoder, led_strip_pixels, sizeof(led_strip_pixels), &tx_config)); + ESP_ERROR_CHECK(rmt_tx_wait_all_done(led_chan, portMAX_DELAY)); vTaskDelay(pdMS_TO_TICKS(EXAMPLE_CHASE_SPEED_MS)); memset(led_strip_pixels, 0, sizeof(led_strip_pixels)); ESP_ERROR_CHECK(rmt_transmit(led_chan, led_encoder, led_strip_pixels, sizeof(led_strip_pixels), &tx_config)); + ESP_ERROR_CHECK(rmt_tx_wait_all_done(led_chan, portMAX_DELAY)); vTaskDelay(pdMS_TO_TICKS(EXAMPLE_CHASE_SPEED_MS)); } start_rgb += 60;