Jelajahi Sumber

Wait for LED DMA transfer before releasing SmartLed buffers

SybexXx 2 hari lalu
induk
melakukan
93644aaeae
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      code/components/jomjol_controlGPIO/server_GPIO.cpp

+ 2 - 3
code/components/jomjol_controlGPIO/server_GPIO.cpp

@@ -320,9 +320,8 @@ void GpioHandler::deinit() {
     }
     }
 #ifdef __LEDGLOBAL
 #ifdef __LEDGLOBAL
     if (leds_global != NULL) {
     if (leds_global != NULL) {
-        if (!leds_global->wait(pdMS_TO_TICKS(1000))) {
-            ESP_LOGW(TAG, "Timed out waiting for LED transmission before deinit");
-        }
+        // Wait until RMT has finished using the LED buffers before destroying the driver.
+        leds_global->wait();
         delete leds_global;
         delete leds_global;
         leds_global = NULL;
         leds_global = NULL;
     }
     }