diff options
author | Martino Facchin <m.facchin@arduino.cc> | 2019-07-19 13:20:36 +0300 |
---|---|---|
committer | Martino Facchin <m.facchin@arduino.cc> | 2019-07-19 13:23:31 +0300 |
commit | 13b74f5ccbb2c02025163f76e709361bbfb0806e (patch) | |
tree | 68c230fd617629fec1761736ee6d8969b9110e9f | |
parent | e6598250587e25aa9a77b79a5ee740101e904674 (diff) |
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 99f6043ced4275bbaad7a21c74930387387b5ddc 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)
-rw-r--r-- | app/src/processing/app/AbstractMonitor.java | 2 | ||||
-rw-r--r-- | app/src/processing/app/Editor.java | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/src/processing/app/AbstractMonitor.java b/app/src/processing/app/AbstractMonitor.java index 9519d1803..42c095aad 100644 --- a/app/src/processing/app/AbstractMonitor.java +++ b/app/src/processing/app/AbstractMonitor.java @@ -85,7 +85,7 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener { suspend(); } } else { - if (closed && (Editor.avoidMultipleOperations == false)) { + if (closed && (Editor.isUploading() == false)) { resume(boardPort); } } diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 3a7d76218..8c05157d5 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -219,7 +219,7 @@ public class Editor extends JFrame implements RunnerListener { private JMenuItem saveAsMenuItem; //boolean presenting; - private boolean uploading; + static private boolean uploading; // undo fellers private JMenuItem undoItem; @@ -2110,6 +2110,10 @@ public class Editor extends JFrame implements RunnerListener { } } + static public boolean isUploading() { + return uploading; + } + private void resumeOrCloseSerialMonitor() { // Return the serial monitor window to its initial state if (serialMonitor != null) { |