Преглед изворни кода

Merge branch 'bugfix/led_strip_potential_buffer_overwrite' into 'master'

example: fix led strip memory overwrite before trans done

Closes IDFGH-10221

See merge request espressif/esp-idf!23898
morris пре 2 година
родитељ
комит
7b97b247ff
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      examples/peripherals/rmt/led_strip/main/led_strip_example_main.c

+ 2 - 0
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;