Skip to content

Support for Linkit SDK #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 23, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
*/
public class ArduinoHelpers extends Common {

private static final String BUILD_PATH_SYSCALLS_SAM3 = "\"{build.path}/syscalls_sam3.c.o\"";
private static final String BUILD_PATH_ARDUINO_SYSCALLS_SAM3 = "\"{build.path}/arduino/syscalls_sam3.c.o\"";
private static final String BUILD_PATH_SYSCALLS_MTK = "\"{build.path}/syscalls_sam3.c.o\"";
private static final String BUILD_PATH_ARDUINO_SYSCALLS_MTK = "\"{build.path}/arduino/syscalls_sam3.c.o\"";

/**
* This method is the internal working class that adds the provided includepath to all configurations and languages.
*
Expand Down Expand Up @@ -559,6 +564,7 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
contribEnv.addVariable(var, confDesc);
// End of Teensy specific settings


if (platformFile.segment(platformFile.segmentCount() - 2).equals("avr")) {
var = new EnvironmentVariable(ENV_KEY_compiler_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH") + "/hardware/tools/avr/bin/");
contribEnv.addVariable(var, confDesc);
Expand All @@ -568,6 +574,9 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
var = new EnvironmentVariable(ENV_KEY_build_generic_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH")
+ "/hardware/tools/g++_arm_none_eabi/arm-none-eabi/bin");
contribEnv.addVariable(var, confDesc);
} else if (platformFile.segment(platformFile.segmentCount() - 2).equals("mtk")) {
var = new EnvironmentVariable(ENV_KEY_build_system_path, makeEnvironmentVar("A.RUNTIME.IDE.PATH") + "/hardware/arduino/mtk/system");
contribEnv.addVariable(var, confDesc);
}

// some glue to make it work
Expand Down Expand Up @@ -638,9 +647,13 @@ private static void setTheEnvironmentVariablesAddthePlatformTxt(IContributedEnvi
if (RealData.length > 0) {
String Var[] = RealData[0].split("=", 2); // look for assignment
if (Var.length == 2) {
String Value = MakeEnvironmentString(Var[1].replace("\"{build.path}/syscalls_sam3.c.o\"",
"\"{build.path}/arduino/syscalls_sam3.c.o\""));
var = new EnvironmentVariable(MakeKeyString(Var[0]), Value);
String value = Var[1];
if (value.contains(BUILD_PATH_SYSCALLS_SAM3)) {
value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_SAM3, BUILD_PATH_ARDUINO_SYSCALLS_SAM3));
} else if (value.contains(BUILD_PATH_SYSCALLS_MTK)) {
value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_MTK, BUILD_PATH_ARDUINO_SYSCALLS_MTK));
}
var = new EnvironmentVariable(MakeKeyString(Var[0]), value);
contribEnv.addVariable(var, confDesc);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public boolean uploadUsingPreferences(IFile hexFile, IProject project, boolean u

command = command.replaceAll(" -P ", " -P " + NewComPort + " ");
String nakedPort = NewComPort.replace("/dev/", "");
command = command.replaceAll(" -port ", " -port " + nakedPort + " ");
command = command.replaceAll(" --port= ", " --port=" + nakedPort + " ");

try {
Expand Down