Skip to content

Commit 13b74f5

Browse files
committed
Avoid reopening the serial monitor during upload
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)
1 parent e659825 commit 13b74f5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/src/processing/app/AbstractMonitor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void actionPerformed(ActionEvent ae) {
8585
suspend();
8686
}
8787
} else {
88-
if (closed && (Editor.avoidMultipleOperations == false)) {
88+
if (closed && (Editor.isUploading() == false)) {
8989
resume(boardPort);
9090
}
9191
}

app/src/processing/app/Editor.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public boolean test(SketchController controller) {
219219
private JMenuItem saveAsMenuItem;
220220

221221
//boolean presenting;
222-
private boolean uploading;
222+
static private boolean uploading;
223223

224224
// undo fellers
225225
private JMenuItem undoItem;
@@ -2110,6 +2110,10 @@ public void run() {
21102110
}
21112111
}
21122112

2113+
static public boolean isUploading() {
2114+
return uploading;
2115+
}
2116+
21132117
private void resumeOrCloseSerialMonitor() {
21142118
// Return the serial monitor window to its initial state
21152119
if (serialMonitor != null) {

0 commit comments

Comments
 (0)