Skip to content

Commit 01a06f3

Browse files
committed
fix for #254
1 parent 82e200d commit 01a06f3

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

+14-4
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,22 @@ public static boolean isArduinoIdeOne() {
220220
public static String GetARDUINODefineValue() {
221221
String Ret;
222222
Ret = getIDEVersion().trim();
223-
if (Ret.contains(".")) {
224-
Ret = Ret.replace(".", "");
225-
if (Ret.length() == 2) {
226-
Ret = Ret.concat("0");
223+
if (Ret.startsWith("1.5")) {
224+
if (Ret.contains(".")) {
225+
Ret = Ret.replace(".", "");
226+
if (Ret.length() == 2) {
227+
Ret = Ret.concat("0");
228+
}
229+
}
230+
} else {
231+
String fields[] = Ret.split("\\.");
232+
if (fields.length != 3) {
233+
Common.log(new Status(IStatus.WARNING, ArduinoConst.CORE_PLUGIN_ID, "Malformed Arduino IDE version expected X.Y.Z got " + Ret, null));
227234
}
235+
Ret = String.format("%d%02d%02d", Integer.valueOf(fields[0]), Integer.valueOf(fields[1]), Integer.valueOf(fields[2]));
236+
228237
}
238+
229239
return Ret;
230240
}
231241

0 commit comments

Comments
 (0)