瀏覽代碼

Fix for ESP32 response timing

Ayush Sharma 4 年之前
父節點
當前提交
f8a15b198c
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/ElegantOTA.cpp

+ 6 - 0
src/ElegantOTA.cpp

@@ -64,6 +64,12 @@ void ElegantOtaClass::setID(const char* id){
         }
         _server->sendHeader("Connection", "close");
         _server->send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
+        #if defined(ESP32)
+          // Needs some time for Core 0 to send response
+          delay(100);
+          yield();
+          delay(100);
+        #endif
         ESP.restart();
       }, [&](){
         // Actual OTA Download