From bfd7e46e6a4d4f9572cd4911588c94fcff67b317 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 7 Oct 2024 11:48:33 +0100 Subject: [PATCH] switch to espruinoEval which is more tolerant of delays --- examples/uartUploadZIP.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/uartUploadZIP.html b/examples/uartUploadZIP.html index f3cc9ef..eb92945 100644 --- a/examples/uartUploadZIP.html +++ b/examples/uartUploadZIP.html @@ -41,8 +41,7 @@ // Get existing files on SD card along with their size and CRCs of first 1k function getExistingFiles() { setStatus("Reading existing files..."); - return new Promise(resolve => { -UART.eval(`(() => { + return UART.getConnection().espruinoEval(`(() => { let info=[]; function recurse(dir,fn) { if (dir[0]=="." || fn[0]==".") return; @@ -59,8 +58,7 @@ } require("fs").readdir().forEach(recurse.bind(null,"")); return info; -})()`, resolve); - }); +})()`); } function uploadZIP() {