瀏覽代碼

Implement erase-first

Paulus Schoutsen 4 年之前
父節點
當前提交
9f2d870fca
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 0
      index.html
  2. 6 1
      src/start-flash.ts

+ 1 - 0
index.html

@@ -56,6 +56,7 @@
         your computer and hit the button:
       </p>
       <esp-web-install-button
+        erase-first
         manifest="firmware_build/manifest.json"
       ></esp-web-install-button>
       <p>

+ 6 - 1
src/start-flash.ts

@@ -129,7 +129,12 @@ export const startFlash = async (
   if (eraseFirst) {
     logEl.addRow({
       id: "erase",
-      content: html`Erasing device`,
+      content: html`Erasing device...`,
+    });
+    await espStub.eraseFlash();
+    logEl.addRow({
+      id: "erase",
+      content: html`Device erased`,
     });
   }