Skip to content

Commit ea44e88

Browse files
committed
Merge branch 'master' of https://github.com/arduino/ARM
2 parents 68e5047 + ab63860 commit ea44e88

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

app/src/processing/app/Base.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
* files and images, etc) that comes from that.
5050
*/
5151
public class Base {
52-
public static final int REVISION = 101;
52+
public static final int REVISION = 150;
5353
/** This might be replaced by main() if there's a lib/version.txt file. */
54-
static String VERSION_NAME = "0101";
54+
static String VERSION_NAME = "0150";
5555
/** Set true if this a proper release rather than a numbered revision. */
5656
static public boolean RELEASE = false;
5757

app/src/processing/app/SerialMonitor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ public void actionPerformed(ActionEvent event) {
139139
Preferences.set("serial.debug_rate", rateString);
140140
closeSerialPort();
141141
try {
142+
Thread.sleep(100); // Wait for serial port to properly close
142143
openSerialPort();
143144
} catch (SerialException e) {
144145
System.err.println(e);
146+
} catch (InterruptedException e) {
147+
e.printStackTrace();
145148
}
146149
}});
147150

app/src/processing/app/debug/BasicUploader.java

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,32 @@ public boolean uploadUsingPreferences(String buildPath, String className,
126126
throw new RunnerException(e);
127127
}
128128

129-
// For Leonardo wait until the bootloader serial port disconnects and the
130-
// sketch serial port reconnects (or timeout after a few seconds if the
131-
// sketch port never comes back). Doing this saves users from accidentally
132-
// opening Serial Monitor on the soon-to-be-orphaned bootloader port.
129+
// Remove the magic baud rate (1200bps) to avoid
130+
// future unwanted board resets
133131
try {
134-
if (uploadResult && waitForUploadPort) {
135-
Thread.sleep(500);
136-
long timeout = System.currentTimeMillis() + 2000;
137-
while (timeout > System.currentTimeMillis()) {
138-
List<String> portList = Serial.list();
139-
String uploadPort = Preferences.get("serial.port");
140-
if (portList.contains(Preferences.get("serial.port"))) {
141-
// Remove the magic baud rate (1200bps) to avoid
142-
// future unwanted board resets
143-
Serial.touchPort(uploadPort, 9600);
144-
break;
132+
if (uploadResult && doTouch) {
133+
String uploadPort = Preferences.get("serial.port");
134+
if (waitForUploadPort) {
135+
// For Due/Leonardo wait until the bootloader serial port disconnects and the
136+
// sketch serial port reconnects (or timeout after a few seconds if the
137+
// sketch port never comes back). Doing this saves users from accidentally
138+
// opening Serial Monitor on the soon-to-be-orphaned bootloader port.
139+
Thread.sleep(500);
140+
long timeout = System.currentTimeMillis() + 2000;
141+
while (timeout > System.currentTimeMillis()) {
142+
List<String> portList = Serial.list();
143+
if (portList.contains(uploadPort)) {
144+
try {
145+
Serial.touchPort(uploadPort, 9600);
146+
break;
147+
} catch (SerialException e) {
148+
// Port already in use
149+
}
150+
}
151+
Thread.sleep(250);
145152
}
146-
Thread.sleep(100);
153+
} else {
154+
Serial.touchPort(uploadPort, 9600);
147155
}
148156
}
149157
} catch (InterruptedException ex) {

todo.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0101 arduino
1+
0150 arduino
22

33
Fix Linux make.sh, etc. scripts
44
Test on Linux.

0 commit comments

Comments
 (0)