diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 1ab981ee0..1e0bdee8b 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -959,17 +959,20 @@ public class Base { //Choose which library to add by chip platform try { - //Find the current target. Get the platform, and then select the correct name and core path. - String platformname = getBoardPreferences().get("platform"); - String targetname = getPlatformPreferences(platformname).get("name"); - String libraryPath = getPlatformPreferences(platformname).get("library.core.path"); + // Find the current target. Get the platform, and then select the correct + // name and core path. + String platformname = getBoardPreferences().get("platform"); + Map platformPrefs = getPlatformPreferences(platformname); + String targetname = platformPrefs.get("name"); + String libraryPath = platformPrefs.get("library.core.path"); + + JMenuItem platformItem = new JMenuItem(targetname); + platformItem.setEnabled(false); + importMenu.add(platformItem); + importMenu.addSeparator(); + for (String p : libraryPath.split(";")) + addLibraries(importMenu, getCoreLibraries(p)); - JMenuItem platformItem = new JMenuItem(targetname); - platformItem.setEnabled(false); - importMenu.add(platformItem); - importMenu.addSeparator(); - addLibraries(importMenu, getCoreLibraries(libraryPath)); - } catch (IOException e) { e.printStackTrace(); } diff --git a/hardware/sam/platforms.txt b/hardware/sam/platforms.txt index e940f8143..3740fdb9e 100755 --- a/hardware/sam/platforms.txt +++ b/hardware/sam/platforms.txt @@ -65,5 +65,5 @@ sam.compiler.upload.cmd= sam.compiler.upload.flags= sam.compiler.define=-DARDUINO= sam.library.path=./hardware/sam/cores/sam -sam.library.core.path=./libraries +sam.library.core.path=./libraries;./hardware/sam/libraries