Skip to content

Commit f486e88

Browse files
author
Konstantin Gredeskoul
committed
Reformat to match Eclipse coding style
1 parent 617f9ce commit f486e88

File tree

2 files changed

+17
-17
lines changed
  • it.baeyens.arduino.common/src/it/baeyens/arduino/arduino
  • it.baeyens.arduino.core/src/it/baeyens/arduino/communication

2 files changed

+17
-17
lines changed

it.baeyens.arduino.common/src/it/baeyens/arduino/arduino/Serial.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,18 @@ public void connect() {
193193
} catch (PortInUseException e) {
194194
String OS = System.getProperty("os.name", "generic").toLowerCase();
195195
boolean isMac, haveVarLock = false;
196-
isMac = ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0));
196+
isMac = ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0));
197197
if (isMac) {
198198
File varLock = new File("/var/lock");
199199
haveVarLock = varLock.exists() && varLock.canWrite();
200-
}
200+
}
201201
if (isMac && !haveVarLock) {
202-
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
203-
+ " not accessible: please run the following command: 'sudo mkdir -p /var/lock && sudo chmod 777 /var/lock'"));
204-
} else {
205-
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
206-
+ " already in use. Try quiting any programs that may be using it", e));
207-
}
202+
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
203+
+ " not accessible: please run the following command: 'sudo mkdir -p /var/lock && sudo chmod 777 /var/lock'"));
204+
} else {
205+
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
206+
+ " already in use. Try quiting any programs that may be using it", e));
207+
}
208208
return;
209209
} catch (Exception e) {
210210
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Error opening serial port " + PortName, e));

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ public static String wait_for_com_Port_to_appear(Vector<String> OriginalPorts, S
6161

6262
// wait for port to disappear
6363
int NumTries = 0;
64-
int MaxTries = 200; // wait for 2 seconds, leaves us 6secs in case we are not seeing disappearing ports but reset worked
65-
int delayMs = 10; // on faster computers Esplora reconnects *extremely* quickly and we can't catch this
64+
int MaxTries = 200; // wait for 2 seconds, leaves us 6secs in case we are not seeing disappearing ports but reset worked
65+
int delayMs = 10; // on faster computers Esplora reconnects *extremely* quickly and we can't catch this
6666
do {
67-
if (NumTries > 0) {
68-
try {
69-
Thread.sleep(delayMs);
70-
} catch (InterruptedException e) {// Jaba is not going to write this
71-
// code
72-
}
73-
}
7467
OriginalPortsCopy = new Vector<String>(OriginalPorts);
68+
if (NumTries > 0) {
69+
try {
70+
Thread.sleep(delayMs);
71+
} catch (InterruptedException e) {// Jaba is not going to write this
72+
// code
73+
}
74+
}
7575
if (NumTries++ > MaxTries) {
7676
Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Leonardo upload port is not disappearing after reset and " + NumTries + " checks"));
7777
return defaultComPort;

0 commit comments

Comments
 (0)