Skip to content

Commit 1410d9b

Browse files
committed
Fixed STOP bug
When connected via USB and using the dashboard the STOP button was not working.
1 parent e4fc666 commit 1410d9b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/connections/connection.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ abstract class Connection {
648648
this.startReaduntil("KeyboardInterrupt:");
649649
await this.writeToDevice("\r" + this.CTRL_CMD_KINTERRUPT); // ctrl-C to interrupt any running program
650650
let result = await this.haltUntilRead(1, 20);
651+
651652
if (result == undefined) {
652653
this.startReaduntil(">>>");
653654
await this.writeToDevice("\r" + this.CTRL_CMD_NORMALMODE); // ctrl-C to interrupt any running program
@@ -656,17 +657,22 @@ abstract class Connection {
656657
return true;
657658
}
658659
}
660+
659661
//try multiple times to get to the prompt
660662
let gotToPrompt = false;
661663
for (let i = 0; i < 20; i++) {
662664
this.startReaduntil(">>>");
663-
await this.writeToDevice("\r" + this.CTRL_CMD_KINTERRUPT);
664-
result = await this.haltUntilRead(2, 5); //this should be fast
665+
await this.writeToDevice("\r" + this.CTRL_CMD_KINTERRUPT + this.CTRL_CMD_KINTERRUPT);
666+
result = await this.haltUntilRead(0, 5); //this should be fast
665667
if (result != undefined && result.length > 0) {
666668
gotToPrompt = true;
667669
break;
668670
}
669671
}
672+
673+
this.startReaduntil(">>>");
674+
await this.writeToDevice("\r" + this.CTRL_CMD_NORMALMODE); // ctrl-C to interrupt any running program
675+
result = await this.haltUntilRead(1, 20);
670676
return gotToPrompt;
671677
}
672678
async prepareForStop() {

0 commit comments

Comments
 (0)