mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Merge branch 'master' of https://github.com/arduino/ARM
This commit is contained in:
commit
ea44e8859d
@ -49,9 +49,9 @@ import static processing.app.I18n._;
|
|||||||
* files and images, etc) that comes from that.
|
* files and images, etc) that comes from that.
|
||||||
*/
|
*/
|
||||||
public class Base {
|
public class Base {
|
||||||
public static final int REVISION = 101;
|
public static final int REVISION = 150;
|
||||||
/** This might be replaced by main() if there's a lib/version.txt file. */
|
/** This might be replaced by main() if there's a lib/version.txt file. */
|
||||||
static String VERSION_NAME = "0101";
|
static String VERSION_NAME = "0150";
|
||||||
/** Set true if this a proper release rather than a numbered revision. */
|
/** Set true if this a proper release rather than a numbered revision. */
|
||||||
static public boolean RELEASE = false;
|
static public boolean RELEASE = false;
|
||||||
|
|
||||||
|
@ -139,9 +139,12 @@ public class SerialMonitor extends JFrame implements MessageConsumer {
|
|||||||
Preferences.set("serial.debug_rate", rateString);
|
Preferences.set("serial.debug_rate", rateString);
|
||||||
closeSerialPort();
|
closeSerialPort();
|
||||||
try {
|
try {
|
||||||
|
Thread.sleep(100); // Wait for serial port to properly close
|
||||||
openSerialPort();
|
openSerialPort();
|
||||||
} catch (SerialException e) {
|
} catch (SerialException e) {
|
||||||
System.err.println(e);
|
System.err.println(e);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
@ -126,24 +126,32 @@ public class BasicUploader extends Uploader {
|
|||||||
throw new RunnerException(e);
|
throw new RunnerException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Leonardo wait until the bootloader serial port disconnects and the
|
// Remove the magic baud rate (1200bps) to avoid
|
||||||
|
// future unwanted board resets
|
||||||
|
try {
|
||||||
|
if (uploadResult && doTouch) {
|
||||||
|
String uploadPort = Preferences.get("serial.port");
|
||||||
|
if (waitForUploadPort) {
|
||||||
|
// For Due/Leonardo wait until the bootloader serial port disconnects and the
|
||||||
// sketch serial port reconnects (or timeout after a few seconds if the
|
// sketch serial port reconnects (or timeout after a few seconds if the
|
||||||
// sketch port never comes back). Doing this saves users from accidentally
|
// sketch port never comes back). Doing this saves users from accidentally
|
||||||
// opening Serial Monitor on the soon-to-be-orphaned bootloader port.
|
// opening Serial Monitor on the soon-to-be-orphaned bootloader port.
|
||||||
try {
|
|
||||||
if (uploadResult && waitForUploadPort) {
|
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
long timeout = System.currentTimeMillis() + 2000;
|
long timeout = System.currentTimeMillis() + 2000;
|
||||||
while (timeout > System.currentTimeMillis()) {
|
while (timeout > System.currentTimeMillis()) {
|
||||||
List<String> portList = Serial.list();
|
List<String> portList = Serial.list();
|
||||||
String uploadPort = Preferences.get("serial.port");
|
if (portList.contains(uploadPort)) {
|
||||||
if (portList.contains(Preferences.get("serial.port"))) {
|
try {
|
||||||
// Remove the magic baud rate (1200bps) to avoid
|
|
||||||
// future unwanted board resets
|
|
||||||
Serial.touchPort(uploadPort, 9600);
|
Serial.touchPort(uploadPort, 9600);
|
||||||
break;
|
break;
|
||||||
|
} catch (SerialException e) {
|
||||||
|
// Port already in use
|
||||||
}
|
}
|
||||||
Thread.sleep(100);
|
}
|
||||||
|
Thread.sleep(250);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Serial.touchPort(uploadPort, 9600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user