mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
Factoring pin definitions out of the core.
That is, there's now a pins/ directory in a platform, which includes multiple directories, each of which has its own pins_arduino.h. The boards.txt gets a new preferences, <BOARD>.build.pins, whose values is a sub-directory of the pins/ directory (possibly with a "platform:" prefix). That sub-directory is then placed in the include path during compilation.
This commit is contained in:
@ -86,17 +86,34 @@ public class Compiler implements MessageConsumer {
|
||||
corePath = coreFolder.getAbsolutePath();
|
||||
} else {
|
||||
Target t = Base.targetsTable.get(core.substring(0, core.indexOf(':')));
|
||||
File coresFolder = new File(t.getFolder(), "cores");
|
||||
File coreFolder = new File(coresFolder, core.substring(core.indexOf(':') + 1));
|
||||
File coreFolder = new File(t.getFolder(), "cores");
|
||||
coreFolder = new File(coreFolder, core.substring(core.indexOf(':') + 1));
|
||||
corePath = coreFolder.getAbsolutePath();
|
||||
}
|
||||
|
||||
String pins = boardPreferences.get("build.pins");
|
||||
String pinsPath = null;
|
||||
|
||||
if (pins != null) {
|
||||
if (pins.indexOf(':') == -1) {
|
||||
Target t = Base.getTarget();
|
||||
File pinsFolder = new File(new File(t.getFolder(), "pins"), pins);
|
||||
pinsPath = pinsFolder.getAbsolutePath();
|
||||
} else {
|
||||
Target t = Base.targetsTable.get(pins.substring(0, pins.indexOf(':')));
|
||||
File pinsFolder = new File(t.getFolder(), "pins");
|
||||
pinsFolder = new File(pinsFolder, pins.substring(pins.indexOf(':') + 1));
|
||||
pinsPath = pinsFolder.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
List<File> objectFiles = new ArrayList<File>();
|
||||
|
||||
// 0. include paths for core + all libraries
|
||||
|
||||
List includePaths = new ArrayList();
|
||||
includePaths.add(corePath);
|
||||
if (pinsPath != null) includePaths.add(pinsPath);
|
||||
for (File file : sketch.getImportedLibraries()) {
|
||||
includePaths.add(file.getPath());
|
||||
}
|
||||
@ -141,6 +158,7 @@ public class Compiler implements MessageConsumer {
|
||||
|
||||
includePaths.clear();
|
||||
includePaths.add(corePath); // include path for core only
|
||||
if (pinsPath != null) includePaths.add(pinsPath);
|
||||
List<File> coreObjectFiles =
|
||||
compileFiles(avrBasePath, buildPath, includePaths,
|
||||
findFilesInPath(corePath, "S", true),
|
||||
|
Reference in New Issue
Block a user