From 8640070d4b8c8370f733f89ce436d33adbb7cd9e Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Mon, 28 Dec 2015 21:57:07 +0100 Subject: [PATCH] Bug 484955 - Provide serial.port.file property, needed for SAM boards. https://github.com/arduino/Arduino/blob/a6e36fac9da3f7d78a99fc5093e94875efac8762/hardware/arduino/sam/platform.txt#L102 uses this property because the bossac tool expects a serial port name without the leading "/dev/". Copied from how the Arduino IDE does this in https://github.com/arduino/Arduino/blob/a6e36fac9da3f7d78a99fc5093e94875efac8762/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java#L148 . Change-Id: I17b2556cab3ad7fba00e03171881f6459cf97826 Signed-off-by: Christian Walther --- .../core/internal/build/ArduinoBuildConfiguration.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/build/ArduinoBuildConfiguration.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/build/ArduinoBuildConfiguration.java index 7f1dc360eb6..044aa2065f8 100644 --- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/build/ArduinoBuildConfiguration.java +++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/build/ArduinoBuildConfiguration.java @@ -416,6 +416,11 @@ public class ArduinoBuildConfiguration extends CBuildConfiguration { Properties properties = getProperties(); properties.put("runtime.tools." + toolName + ".path", pathString(tool.getInstallPath())); //$NON-NLS-1$ //$NON-NLS-2$ properties.put("serial.port", serialPort); //$NON-NLS-1$ + if (serialPort.startsWith("/dev/")) { + properties.put("serial.port.file", serialPort.substring(5)); //$NON-NLS-1$ + } else { + properties.put("serial.port.file", serialPort); //$NON-NLS-1$ + } // to make up for some cheating in the platform.txt file properties.put("path", "{tools." + toolName + ".path}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ properties.put("cmd.path", "{tools." + toolName + ".cmd.path}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$