From 4dc21cee6c5d2c758519be3782109c221c3b0ff1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Sun, 5 Jan 2014 12:42:27 +0100 Subject: [PATCH] Fixed "runtime.hardware.path" and "runtime.platform.path" values "runtime.hardware.path" now contains the path to the hardware folder of the currently selected board and "runtime.platform.path" the path to the specific platform. This should fix #1176 and #1761. --- app/src/processing/app/Base.java | 4 ++++ app/src/processing/app/Preferences.java | 1 - hardware/arduino/avr/platform.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 5f351f764..9f2635f9e 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1554,6 +1554,10 @@ public class Base { Preferences.set("target_platform", targetPlatform.getId()); Preferences.set("board", targetBoard.getId()); + File platformFolder = targetPlatform.getFolder(); + Preferences.set("runtime.platform.path", platformFolder.getAbsolutePath()); + Preferences.set("runtime.hardware.path", platformFolder.getParentFile().getAbsolutePath()); + filterVisibilityOfSubsequentBoardMenus(targetBoard, 1); onBoardOrPortChange(); diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index ed47cae30..294c07603 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -231,7 +231,6 @@ public class Preferences { // set some runtime constants (not saved on preferences file) File hardwareFolder = Base.getHardwareFolder(); - table.put("runtime.hardware.path", hardwareFolder.getAbsolutePath()); table.put("runtime.ide.path", hardwareFolder.getParentFile().getAbsolutePath()); table.put("runtime.ide.version", "" + Base.REVISION); diff --git a/hardware/arduino/avr/platform.txt b/hardware/arduino/avr/platform.txt index 4e28f0a38..3066ce469 100644 --- a/hardware/arduino/avr/platform.txt +++ b/hardware/arduino/avr/platform.txt @@ -84,7 +84,7 @@ tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{bu tools.avrdude.bootloader.params.verbose=-v -v -v -v tools.avrdude.bootloader.params.quiet=-q -q -tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.ide.path}/hardware/arduino/avr/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m +tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m # USB Default Flags