Skip to content

Commit efec19f

Browse files
committed
small bug fixes
Added to the disconnect delay for brower bug, Made the update persent not go past 100 by using floor instead of round, Improved stop function with serial
1 parent cdbc96f commit efec19f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

js/repl.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class ReplJS{
434434
REPL.STOP = false;
435435
REPL.BUSY = false;
436436
//bug must wait for a bit before trying to reconnect. Known Web Bluetooth bug.
437-
await new Promise(r => setTimeout(r, 300));
437+
await new Promise(r => setTimeout(r, 400));
438438
REPL.bleReconnect();
439439
}
440440

@@ -1504,7 +1504,7 @@ class ReplJS{
15041504
let jresp = JSON.parse(response);
15051505
var urls = jresp.urls;
15061506
window.setPercent(1, "Updating XRPLib...");
1507-
let percent_per = Math.round(99 / (urls.length + window.phewList.length + window.bleList.length + 1));
1507+
let percent_per = Math.floor(99 / (urls.length + window.phewList.length + window.bleList.length + 1));
15081508
let cur_percent = 1 + percent_per;
15091509

15101510
await this.deleteFileOrDir("/lib/XRPLib"); //delete all the files first to avoid any confusion.
@@ -1652,6 +1652,8 @@ class ReplJS{
16521652
}
16531653
//try multiple times to get to the prompt
16541654
var gotToPrompt = false;
1655+
await this.getToNormal();
1656+
//await this.writeToDevice("\r" + this.CTRL_CMD_NORMALMODE);
16551657
for(let i=0;i<20;i++){
16561658
this.startReaduntil(">>>");
16571659
await this.writeToDevice("\r" + this.CTRL_CMD_KINTERRUPT);

0 commit comments

Comments
 (0)