Skip to content

Commit aa1ad5b

Browse files
committed
Merge pull request #198 from henols/master
Support for Linkit SDK
2 parents 3e1c82d + a74f08c commit aa1ad5b

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/tools/ArduinoHelpers.java

+16-3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
*/
7171
public class ArduinoHelpers extends Common {
7272

73+
private static final String BUILD_PATH_SYSCALLS_SAM3 = "\"{build.path}/syscalls_sam3.c.o\"";
74+
private static final String BUILD_PATH_ARDUINO_SYSCALLS_SAM3 = "\"{build.path}/arduino/syscalls_sam3.c.o\"";
75+
private static final String BUILD_PATH_SYSCALLS_MTK = "\"{build.path}/syscalls_sam3.c.o\"";
76+
private static final String BUILD_PATH_ARDUINO_SYSCALLS_MTK = "\"{build.path}/arduino/syscalls_sam3.c.o\"";
77+
7378
/**
7479
* This method is the internal working class that adds the provided includepath to all configurations and languages.
7580
*
@@ -559,6 +564,7 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
559564
contribEnv.addVariable(var, confDesc);
560565
// End of Teensy specific settings
561566

567+
562568
if (platformFile.segment(platformFile.segmentCount() - 2).equals("avr")) {
563569
var = new EnvironmentVariable(ENV_KEY_compiler_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH") + "/hardware/tools/avr/bin/");
564570
contribEnv.addVariable(var, confDesc);
@@ -568,6 +574,9 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
568574
var = new EnvironmentVariable(ENV_KEY_build_generic_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH")
569575
+ "/hardware/tools/g++_arm_none_eabi/arm-none-eabi/bin");
570576
contribEnv.addVariable(var, confDesc);
577+
} else if (platformFile.segment(platformFile.segmentCount() - 2).equals("mtk")) {
578+
var = new EnvironmentVariable(ENV_KEY_build_system_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH") + "/hardware/arduino/mtk/system");
579+
contribEnv.addVariable(var, confDesc);
571580
}
572581

573582
// some glue to make it work
@@ -638,9 +647,13 @@ private static void setTheEnvironmentVariablesAddthePlatformTxt(IContributedEnvi
638647
if (RealData.length > 0) {
639648
String Var[] = RealData[0].split("=", 2); // look for assignment
640649
if (Var.length == 2) {
641-
String Value = MakeEnvironmentString(Var[1].replace("\"{build.path}/syscalls_sam3.c.o\"",
642-
"\"{build.path}/arduino/syscalls_sam3.c.o\""));
643-
var = new EnvironmentVariable(MakeKeyString(Var[0]), Value);
650+
String value = Var[1];
651+
if (value.contains(BUILD_PATH_SYSCALLS_SAM3)) {
652+
value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_SAM3, BUILD_PATH_ARDUINO_SYSCALLS_SAM3));
653+
} else if (value.contains(BUILD_PATH_SYSCALLS_MTK)) {
654+
value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_MTK, BUILD_PATH_ARDUINO_SYSCALLS_MTK));
655+
}
656+
var = new EnvironmentVariable(MakeKeyString(Var[0]), value);
644657
contribEnv.addVariable(var, confDesc);
645658
}
646659
}

it.baeyens.arduino.core/src/it/baeyens/arduino/tools/uploaders/arduinoUploader.java

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public boolean uploadUsingPreferences(IFile hexFile, IProject project, boolean u
3636

3737
command = command.replaceAll(" -P ", " -P " + NewComPort + " ");
3838
String nakedPort = NewComPort.replace("/dev/", "");
39+
command = command.replaceAll(" -port ", " -port " + nakedPort + " ");
3940
command = command.replaceAll(" --port= ", " --port=" + nakedPort + " ");
4041

4142
try {

0 commit comments

Comments
 (0)