Skip to content

Commit bfd7e46

Browse files
committed
switch to espruinoEval which is more tolerant of delays
1 parent 6bda957 commit bfd7e46

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/uartUploadZIP.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
// Get existing files on SD card along with their size and CRCs of first 1k
4242
function getExistingFiles() {
4343
setStatus("Reading existing files...");
44-
return new Promise(resolve => {
45-
UART.eval(`(() => {
44+
return UART.getConnection().espruinoEval(`(() => {
4645
let info=[];
4746
function recurse(dir,fn) {
4847
if (dir[0]=="." || fn[0]==".") return;
@@ -59,8 +58,7 @@
5958
}
6059
require("fs").readdir().forEach(recurse.bind(null,""));
6160
return info;
62-
})()`, resolve);
63-
});
61+
})()`);
6462
}
6563

6664
function uploadZIP() {

0 commit comments

Comments
 (0)