Skip to content

Commit c17ede5

Browse files
committed
Some changes to the upload. Mostly removing hard coded stuff
1 parent 301723b commit c17ede5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/communication/ArduinoSerial.java

+20-20
Original file line numberDiff line numberDiff line change
@@ -173,33 +173,33 @@ public static String makeArduinoUploadready(MessageConsoleStream console, IProje
173173
.equalsIgnoreCase("true");
174174
String boardName = Common.getBuildEnvironmentVariable(project, configName, ArduinoConst.ENV_KEY_JANTJE_BOARD_NAME, "");
175175

176-
if (use_1200bps_touch /*
177-
* || boardName.equalsIgnoreCase("Arduino leonardo") || boardName.equalsIgnoreCase("Arduino Micro") ||
178-
* boardName.equalsIgnoreCase("Arduino Esplora") || boardName.startsWith("Arduino Due")
179-
*/) {
176+
if (use_1200bps_touch) {
180177
// Get the list of the current com serial ports
181178
console.println("Starting reset using 1200bps touch process");
182179
Vector<String> OriginalPorts = Serial.list();
183180

184-
if (!reset_Arduino_by_baud_rate(ComPort, 1200, 100) || boardName.startsWith("Arduino Due") || boardName.startsWith("Digistump DigiX")) {
181+
if (!reset_Arduino_by_baud_rate(ComPort, 1200, 100) /* || */) {
185182
console.println("reset using 1200bps touch failed");
186-
// Give the DUE/DigiX Atmel SAM-BA bootloader time to switch-in after the reset
187-
try {
188-
Thread.sleep(2000);
189-
} catch (InterruptedException ex) {
190-
// ignore error
183+
184+
} else {
185+
if (boardName.startsWith("Digistump DigiX")) {
186+
// Give the DUE/DigiX Atmel SAM-BA bootloader time to switch-in after the reset
187+
try {
188+
Thread.sleep(2000);
189+
} catch (InterruptedException ex) {
190+
// ignore error
191+
}
192+
}
193+
if (bwait_for_upload_port) {
194+
String NewComport = wait_for_com_Port_to_appear(console, OriginalPorts, ComPort);
195+
console.println("Using comport " + NewComport + " from now onwards");
196+
console.println("Ending reset using 1200bps touch process");
197+
return NewComport;
191198
}
192-
console.println("Continuing to use " + ComPort);
193-
console.println("Ending reset using 1200bps touch process");
194-
return ComPort;
195-
}
196-
if (boardName.equalsIgnoreCase("Arduino leonardo") || boardName.equalsIgnoreCase("Arduino Micro")
197-
|| boardName.equalsIgnoreCase("Arduino Esplora") || bwait_for_upload_port) {
198-
String NewComport = wait_for_com_Port_to_appear(console, OriginalPorts, ComPort);
199-
console.println("Using comport " + NewComport + " from now onwards");
200-
console.println("Ending reset using 1200bps touch process");
201-
return NewComport;
202199
}
200+
console.println("Continuing to use " + ComPort);
201+
console.println("Ending reset using 1200bps touch process");
202+
return ComPort;
203203
}
204204

205205
// connect to the serial port

0 commit comments

Comments
 (0)