Skip to content

Commit

Permalink
Avoid reopening the serial monitor during upload
Browse files Browse the repository at this point in the history
avoidMultipleOperations becomes false with a 10 seconds timeout after pressing the compile button.

The new code introduced by 99f6043 didn't take this into account, so the port was being reopened before staring the actual upload.

Also, make uploading variable static to avoid preferences confusion (this should be solved in a saner way giving every Editor instance its own set of properties, but it will hopefully fixes by the cli integration and workspace concept)
  • Loading branch information
facchinm committed Jul 19, 2019
1 parent e659825 commit 13b74f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/processing/app/AbstractMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void actionPerformed(ActionEvent ae) {
suspend();
}
} else {
if (closed && (Editor.avoidMultipleOperations == false)) {
if (closed && (Editor.isUploading() == false)) {
resume(boardPort);
}
}
Expand Down
6 changes: 5 additions & 1 deletion app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public boolean test(SketchController controller) {
private JMenuItem saveAsMenuItem;

//boolean presenting;
private boolean uploading;
static private boolean uploading;

// undo fellers
private JMenuItem undoItem;
Expand Down Expand Up @@ -2110,6 +2110,10 @@ public void run() {
}
}

static public boolean isUploading() {
return uploading;
}

private void resumeOrCloseSerialMonitor() {
// Return the serial monitor window to its initial state
if (serialMonitor != null) {
Expand Down

0 comments on commit 13b74f5

Please sign in to comment.