mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Merging third-party hardware branch: svn merge -r 795:802 https://arduino.googlecode.com/svn/branches/third-party-hardware .
This commit is contained in:
commit
42ddb48786
@ -30,6 +30,7 @@ import java.util.*;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import processing.app.debug.Compiler;
|
import processing.app.debug.Compiler;
|
||||||
|
import processing.app.debug.Target;
|
||||||
import processing.core.*;
|
import processing.core.*;
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +86,8 @@ public class Base {
|
|||||||
// found in the sketchbook)
|
// found in the sketchbook)
|
||||||
static public String librariesClassPath;
|
static public String librariesClassPath;
|
||||||
|
|
||||||
|
static public HashMap<String, Target> targetsTable;
|
||||||
|
|
||||||
// Location for untitled items
|
// Location for untitled items
|
||||||
static File untitledFolder;
|
static File untitledFolder;
|
||||||
|
|
||||||
@ -246,7 +249,7 @@ public class Base {
|
|||||||
// Get paths for the libraries and examples in the Processing folder
|
// Get paths for the libraries and examples in the Processing folder
|
||||||
//String workingDirectory = System.getProperty("user.dir");
|
//String workingDirectory = System.getProperty("user.dir");
|
||||||
examplesFolder = getContentFile("examples");
|
examplesFolder = getContentFile("examples");
|
||||||
librariesFolder = new File(getContentFile("hardware"), "libraries");
|
librariesFolder = getContentFile("libraries");
|
||||||
toolsFolder = getContentFile("tools");
|
toolsFolder = getContentFile("tools");
|
||||||
|
|
||||||
// Get the sketchbook path, and make sure it's set properly
|
// Get the sketchbook path, and make sure it's set properly
|
||||||
@ -276,6 +279,10 @@ public class Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
targetsTable = new HashMap<String, Target>();
|
||||||
|
loadHardware(getHardwareFolder());
|
||||||
|
loadHardware(getSketchbookHardwareFolder());
|
||||||
|
|
||||||
// Check if there were previously opened sketches to be restored
|
// Check if there were previously opened sketches to be restored
|
||||||
boolean opened = restoreSketches();
|
boolean opened = restoreSketches();
|
||||||
|
|
||||||
@ -987,6 +994,56 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void rebuildBoardsMenu(JMenu menu) {
|
||||||
|
//System.out.println("rebuilding boards menu");
|
||||||
|
menu.removeAll();
|
||||||
|
ButtonGroup group = new ButtonGroup();
|
||||||
|
for (Target target : targetsTable.values()) {
|
||||||
|
for (String board : target.getBoards().keySet()) {
|
||||||
|
AbstractAction action =
|
||||||
|
new AbstractAction(target.getBoards().get(board).get("name")) {
|
||||||
|
public void actionPerformed(ActionEvent actionevent) {
|
||||||
|
//System.out.println("Switching to " + target + ":" + board);
|
||||||
|
Preferences.set("target", (String) getValue("target"));
|
||||||
|
Preferences.set("board", (String) getValue("board"));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
action.putValue("target", target.getName());
|
||||||
|
action.putValue("board", board);
|
||||||
|
JMenuItem item = new JRadioButtonMenuItem(action);
|
||||||
|
if (target.getName().equals(Preferences.get("target")) &&
|
||||||
|
board.equals(Preferences.get("board"))) {
|
||||||
|
item.setSelected(true);
|
||||||
|
}
|
||||||
|
group.add(item);
|
||||||
|
menu.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void rebuildBurnBootloaderMenu(JMenu menu) {
|
||||||
|
//System.out.println("rebuilding burn bootloader menu");
|
||||||
|
menu.removeAll();
|
||||||
|
for (Target target : targetsTable.values()) {
|
||||||
|
for (String programmer : target.getProgrammers().keySet()) {
|
||||||
|
AbstractAction action =
|
||||||
|
new AbstractAction(
|
||||||
|
"w/ " + target.getProgrammers().get(programmer).get("name")) {
|
||||||
|
public void actionPerformed(ActionEvent actionevent) {
|
||||||
|
activeEditor.handleBurnBootloader((String) getValue("target"),
|
||||||
|
(String) getValue("programmer"));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
action.putValue("target", target.getName());
|
||||||
|
action.putValue("programmer", programmer);
|
||||||
|
JMenuItem item = new JMenuItem(action);
|
||||||
|
menu.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scan a folder recursively, and add any sketches found to the menu
|
* Scan a folder recursively, and add any sketches found to the menu
|
||||||
* specified. Set the openReplaces parameter to true when opening the sketch
|
* specified. Set the openReplaces parameter to true when opening the sketch
|
||||||
@ -1138,7 +1195,8 @@ public class Base {
|
|||||||
// String packages[] =
|
// String packages[] =
|
||||||
// Compiler.packageListFromClassPath(libraryClassPath);
|
// Compiler.packageListFromClassPath(libraryClassPath);
|
||||||
libraries.add(subfolder);
|
libraries.add(subfolder);
|
||||||
String packages[] = Compiler.headerListFromIncludePath(subfolder.getAbsolutePath());
|
String packages[] =
|
||||||
|
Compiler.headerListFromIncludePath(subfolder.getAbsolutePath());
|
||||||
for (String pkg : packages) {
|
for (String pkg : packages) {
|
||||||
importToLibraryTable.put(pkg, subfolder);
|
importToLibraryTable.put(pkg, subfolder);
|
||||||
}
|
}
|
||||||
@ -1164,6 +1222,31 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void loadHardware(File folder) {
|
||||||
|
if (!folder.isDirectory()) return;
|
||||||
|
|
||||||
|
String list[] = folder.list(new FilenameFilter() {
|
||||||
|
public boolean accept(File dir, String name) {
|
||||||
|
// skip .DS_Store files, .svn folders, etc
|
||||||
|
if (name.charAt(0) == '.') return false;
|
||||||
|
if (name.equals("CVS")) return false;
|
||||||
|
return (new File(dir, name).isDirectory());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// if a bad folder or something like that, this might come back null
|
||||||
|
if (list == null) return;
|
||||||
|
|
||||||
|
// alphabetize list, since it's not always alpha order
|
||||||
|
// replaced hella slow bubble sort with this feller for 0093
|
||||||
|
Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
|
||||||
|
|
||||||
|
for (String target : list) {
|
||||||
|
File subfolder = new File(folder, target);
|
||||||
|
targetsTable.put(target, new Target(target, subfolder));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// .................................................................
|
// .................................................................
|
||||||
|
|
||||||
|
|
||||||
@ -1433,6 +1516,16 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static public Target getTarget() {
|
||||||
|
return Base.targetsTable.get(Preferences.get("target"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static public Map<String, String> getBoardPreferences() {
|
||||||
|
return getTarget().getBoards().get(Preferences.get("board"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static public File getSketchbookFolder() {
|
static public File getSketchbookFolder() {
|
||||||
return new File(Preferences.get("sketchbook.path"));
|
return new File(Preferences.get("sketchbook.path"));
|
||||||
}
|
}
|
||||||
@ -1448,6 +1541,11 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static public File getSketchbookHardwareFolder() {
|
||||||
|
return new File(getSketchbookFolder(), "hardware");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected File getDefaultSketchbookFolder() {
|
protected File getDefaultSketchbookFolder() {
|
||||||
File sketchbookFolder = null;
|
File sketchbookFolder = null;
|
||||||
try {
|
try {
|
||||||
|
@ -706,16 +706,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
if (boardsMenu == null) {
|
if (boardsMenu == null) {
|
||||||
boardsMenu = new JMenu("Board");
|
boardsMenu = new JMenu("Board");
|
||||||
ButtonGroup boardGroup = new ButtonGroup();
|
base.rebuildBoardsMenu(boardsMenu);
|
||||||
for (Iterator i = Preferences.getSubKeys("boards"); i.hasNext(); ) {
|
|
||||||
String board = (String) i.next();
|
|
||||||
Action action = new BoardMenuAction(board);
|
|
||||||
item = new JRadioButtonMenuItem(action);
|
|
||||||
if (board.equals(Preferences.get("board")))
|
|
||||||
item.setSelected(true);
|
|
||||||
boardGroup.add(item);
|
|
||||||
boardsMenu.add(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
menu.add(boardsMenu);
|
menu.add(boardsMenu);
|
||||||
|
|
||||||
@ -729,12 +720,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
||||||
JMenu bootloaderMenu = new JMenu("Burn Bootloader");
|
JMenu bootloaderMenu = new JMenu("Burn Bootloader");
|
||||||
for (Iterator i = Preferences.getSubKeys("programmers"); i.hasNext(); ) {
|
base.rebuildBurnBootloaderMenu(bootloaderMenu);
|
||||||
String programmer = (String) i.next();
|
|
||||||
Action action = new BootloaderMenuAction(programmer);
|
|
||||||
item = new JMenuItem(action);
|
|
||||||
bootloaderMenu.add(item);
|
|
||||||
}
|
|
||||||
menu.add(bootloaderMenu);
|
menu.add(bootloaderMenu);
|
||||||
|
|
||||||
menu.addMenuListener(new MenuListener() {
|
menu.addMenuListener(new MenuListener() {
|
||||||
@ -964,30 +950,6 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class BoardMenuAction extends AbstractAction {
|
|
||||||
private String board;
|
|
||||||
public BoardMenuAction(String board) {
|
|
||||||
super(Preferences.get("boards." + board + ".name"));
|
|
||||||
this.board = board;
|
|
||||||
}
|
|
||||||
public void actionPerformed(ActionEvent actionevent) {
|
|
||||||
//System.out.println("Switching to " + board);
|
|
||||||
Preferences.set("board", board);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class BootloaderMenuAction extends AbstractAction {
|
|
||||||
private String programmer;
|
|
||||||
public BootloaderMenuAction(String programmer) {
|
|
||||||
super("w/ " + Preferences.get("programmers." + programmer + ".name"));
|
|
||||||
this.programmer = programmer;
|
|
||||||
}
|
|
||||||
public void actionPerformed(ActionEvent actionevent) {
|
|
||||||
handleBurnBootloader(programmer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void populateSerialMenu() {
|
protected void populateSerialMenu() {
|
||||||
// getting list of ports
|
// getting list of ports
|
||||||
|
|
||||||
@ -1842,10 +1804,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
sketch.compile(new Target(
|
sketch.compile(verbose);
|
||||||
Base.getHardwarePath() + File.separator + "cores",
|
|
||||||
Preferences.get("boards." + Preferences.get("board") + ".build.core")),
|
|
||||||
verbose);
|
|
||||||
statusNotice("Done compiling.");
|
statusNotice("Done compiling.");
|
||||||
} catch (RunnerException e) {
|
} catch (RunnerException e) {
|
||||||
//statusError("Error compiling...");
|
//statusError("Error compiling...");
|
||||||
@ -2257,10 +2216,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
uploading = true;
|
uploading = true;
|
||||||
|
|
||||||
boolean success = sketch.exportApplet(new Target(
|
boolean success = sketch.exportApplet(verbose);
|
||||||
Base.getHardwarePath() + File.separator + "cores",
|
|
||||||
Preferences.get("boards." + Preferences.get("board") + ".build.core")),
|
|
||||||
verbose);
|
|
||||||
if (success) {
|
if (success) {
|
||||||
statusNotice("Done uploading.");
|
statusNotice("Done uploading.");
|
||||||
} else {
|
} else {
|
||||||
@ -2323,14 +2279,14 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void handleBurnBootloader(final String programmer) {
|
protected void handleBurnBootloader(final String target, final String programmer) {
|
||||||
console.clear();
|
console.clear();
|
||||||
statusNotice("Burning bootloader to I/O Board (this may take a minute)...");
|
statusNotice("Burning bootloader to I/O Board (this may take a minute)...");
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Uploader uploader = new AvrdudeUploader();
|
Uploader uploader = new AvrdudeUploader();
|
||||||
if (uploader.burnBootloader(programmer)) {
|
if (uploader.burnBootloader(target, programmer)) {
|
||||||
statusNotice("Done burning bootloader.");
|
statusNotice("Done burning bootloader.");
|
||||||
} else {
|
} else {
|
||||||
statusError("Error while burning bootloader.");
|
statusError("Error while burning bootloader.");
|
||||||
|
@ -131,7 +131,6 @@ public class Preferences {
|
|||||||
|
|
||||||
static Hashtable defaults;
|
static Hashtable defaults;
|
||||||
static Hashtable table = new Hashtable();;
|
static Hashtable table = new Hashtable();;
|
||||||
static Hashtable prefixes = new Hashtable();
|
|
||||||
static File preferencesFile;
|
static File preferencesFile;
|
||||||
|
|
||||||
|
|
||||||
@ -199,25 +198,6 @@ public class Preferences {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
load(new FileInputStream(new File(Base.getHardwareFolder(), "boards.txt")),
|
|
||||||
"boards");
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Base.showError("Error reading board definitions",
|
|
||||||
"Error reading the board definitions file (" +
|
|
||||||
new File(Base.getHardwareFolder(), "boards.txt").getAbsolutePath() + "). " +
|
|
||||||
"Please re-download or re-unzip Arduino.\n", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
load(new FileInputStream(new File(Base.getHardwareFolder(), "programmers.txt")),
|
|
||||||
"programmers");
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Base.showError("Error reading programmers definitions",
|
|
||||||
"Error reading the programmers definitions file. " +
|
|
||||||
"Please re-download or re-unzip Arduino.\n", ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -569,13 +549,7 @@ public class Preferences {
|
|||||||
load(input, table);
|
load(input, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected void load(InputStream input, String prefix) throws IOException {
|
static public void load(InputStream input, Map table) throws IOException {
|
||||||
LinkedHashMap table = new LinkedHashMap();
|
|
||||||
prefixes.put(prefix, table);
|
|
||||||
load(input, table);
|
|
||||||
}
|
|
||||||
|
|
||||||
static protected void load(InputStream input, Map table) throws IOException {
|
|
||||||
String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
|
String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
if ((line.length() == 0) ||
|
if ((line.length() == 0) ||
|
||||||
@ -630,18 +604,6 @@ public class Preferences {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
static public String get(String attribute /*, String defaultValue */) {
|
static public String get(String attribute /*, String defaultValue */) {
|
||||||
// if the attribute starts with a prefix used by one of our subsidiary
|
|
||||||
// preference files, look up the attribute in that file's Hashtable
|
|
||||||
// (don't override with or fallback to the main file). otherwise,
|
|
||||||
// look up the attribute in the main file's Hashtable.
|
|
||||||
Map table = Preferences.table;
|
|
||||||
if (attribute.indexOf('.') != -1) {
|
|
||||||
String prefix = attribute.substring(0, attribute.indexOf('.'));
|
|
||||||
if (prefixes.containsKey(prefix)) {
|
|
||||||
table = (Map) prefixes.get(prefix);
|
|
||||||
attribute = attribute.substring(attribute.indexOf('.') + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (String) table.get(attribute);
|
return (String) table.get(attribute);
|
||||||
/*
|
/*
|
||||||
//String value = (properties != null) ?
|
//String value = (properties != null) ?
|
||||||
@ -654,28 +616,6 @@ public class Preferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the top-level key prefixes defined in the subsidiary file loaded with
|
|
||||||
* the given prefix. For example, if the file contains:
|
|
||||||
* foo.count=1
|
|
||||||
* bar.count=2
|
|
||||||
* baz.count=3
|
|
||||||
* this will return { "foo", "bar", "baz" }.
|
|
||||||
*/
|
|
||||||
static public Iterator getSubKeys(String prefix) {
|
|
||||||
if (!prefixes.containsKey(prefix))
|
|
||||||
return null;
|
|
||||||
Set subkeys = new LinkedHashSet();
|
|
||||||
for (Iterator i = ((Map) prefixes.get(prefix)).keySet().iterator(); i.hasNext(); ) {
|
|
||||||
String subkey = (String) i.next();
|
|
||||||
if (subkey.indexOf('.') != -1)
|
|
||||||
subkey = subkey.substring(0, subkey.indexOf('.'));
|
|
||||||
subkeys.add(subkey);
|
|
||||||
}
|
|
||||||
return subkeys.iterator();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static public String getDefault(String attribute) {
|
static public String getDefault(String attribute) {
|
||||||
return (String) defaults.get(attribute);
|
return (String) defaults.get(attribute);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,6 @@ import processing.app.debug.AvrdudeUploader;
|
|||||||
import processing.app.debug.Compiler;
|
import processing.app.debug.Compiler;
|
||||||
import processing.app.debug.RunnerException;
|
import processing.app.debug.RunnerException;
|
||||||
import processing.app.debug.Sizer;
|
import processing.app.debug.Sizer;
|
||||||
import processing.app.debug.Target;
|
|
||||||
import processing.app.debug.Uploader;
|
import processing.app.debug.Uploader;
|
||||||
import processing.app.preproc.*;
|
import processing.app.preproc.*;
|
||||||
import processing.core.*;
|
import processing.core.*;
|
||||||
@ -1142,7 +1141,7 @@ public class Sketch {
|
|||||||
* X. afterwards, some of these steps need a cleanup function
|
* X. afterwards, some of these steps need a cleanup function
|
||||||
* </PRE>
|
* </PRE>
|
||||||
*/
|
*/
|
||||||
protected String compile(Target target, boolean verbose)
|
protected String compile(boolean verbose)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
@ -1177,7 +1176,7 @@ public class Sketch {
|
|||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
// handle preprocessing the main file's code
|
// handle preprocessing the main file's code
|
||||||
name = build(tempBuildFolder.getAbsolutePath(), target, verbose);
|
name = build(tempBuildFolder.getAbsolutePath(), verbose);
|
||||||
size(tempBuildFolder.getAbsolutePath(), name);
|
size(tempBuildFolder.getAbsolutePath(), name);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
@ -1199,11 +1198,11 @@ public class Sketch {
|
|||||||
* @param buildPath Location to copy all the .java files
|
* @param buildPath Location to copy all the .java files
|
||||||
* @return null if compilation failed, main class name if not
|
* @return null if compilation failed, main class name if not
|
||||||
*/
|
*/
|
||||||
public String preprocess(String buildPath, Target target) throws RunnerException {
|
public String preprocess(String buildPath) throws RunnerException {
|
||||||
return preprocess(buildPath, new PdePreprocessor(), target);
|
return preprocess(buildPath, new PdePreprocessor());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String preprocess(String buildPath, PdePreprocessor preprocessor, Target target) throws RunnerException {
|
public String preprocess(String buildPath, PdePreprocessor preprocessor) throws RunnerException {
|
||||||
// make sure the user didn't hide the sketch folder
|
// make sure the user didn't hide the sketch folder
|
||||||
ensureExistence();
|
ensureExistence();
|
||||||
|
|
||||||
@ -1279,8 +1278,7 @@ public class Sketch {
|
|||||||
headerOffset = preprocessor.writePrefix(bigCode.toString(),
|
headerOffset = preprocessor.writePrefix(bigCode.toString(),
|
||||||
buildPath,
|
buildPath,
|
||||||
name,
|
name,
|
||||||
codeFolderPackages,
|
codeFolderPackages);
|
||||||
target);
|
|
||||||
} catch (FileNotFoundException fnfe) {
|
} catch (FileNotFoundException fnfe) {
|
||||||
fnfe.printStackTrace();
|
fnfe.printStackTrace();
|
||||||
String msg = "Build folder disappeared or could not be written";
|
String msg = "Build folder disappeared or could not be written";
|
||||||
@ -1378,31 +1376,31 @@ public class Sketch {
|
|||||||
*
|
*
|
||||||
* @return null if compilation failed, main class name if not
|
* @return null if compilation failed, main class name if not
|
||||||
*/
|
*/
|
||||||
public String build(String buildPath, Target target, boolean verbose)
|
public String build(String buildPath, boolean verbose)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
|
|
||||||
// run the preprocessor
|
// run the preprocessor
|
||||||
String primaryClassName = preprocess(buildPath, target);
|
String primaryClassName = preprocess(buildPath);
|
||||||
|
|
||||||
// compile the program. errors will happen as a RunnerException
|
// compile the program. errors will happen as a RunnerException
|
||||||
// that will bubble up to whomever called build().
|
// that will bubble up to whomever called build().
|
||||||
Compiler compiler = new Compiler();
|
Compiler compiler = new Compiler();
|
||||||
if (compiler.compile(this, buildPath, primaryClassName, target, verbose)) {
|
if (compiler.compile(this, buildPath, primaryClassName, verbose)) {
|
||||||
return primaryClassName;
|
return primaryClassName;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected boolean exportApplet(Target target, boolean verbose) throws Exception {
|
protected boolean exportApplet(boolean verbose) throws Exception {
|
||||||
return exportApplet(new File(folder, "applet").getAbsolutePath(), target, verbose);
|
return exportApplet(new File(folder, "applet").getAbsolutePath(), verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle export to applet.
|
* Handle export to applet.
|
||||||
*/
|
*/
|
||||||
public boolean exportApplet(String appletPath, Target target, boolean verbose)
|
public boolean exportApplet(String appletPath, boolean verbose)
|
||||||
throws RunnerException, IOException {
|
throws RunnerException, IOException {
|
||||||
|
|
||||||
// Make sure the user didn't hide the sketch folder
|
// Make sure the user didn't hide the sketch folder
|
||||||
@ -1426,7 +1424,7 @@ public class Sketch {
|
|||||||
appletFolder.mkdirs();
|
appletFolder.mkdirs();
|
||||||
|
|
||||||
// build the sketch
|
// build the sketch
|
||||||
String foundName = build(appletFolder.getPath(), target, false);
|
String foundName = build(appletFolder.getPath(), false);
|
||||||
// (already reported) error during export, exit this function
|
// (already reported) error during export, exit this function
|
||||||
if (foundName == null) return false;
|
if (foundName == null) return false;
|
||||||
|
|
||||||
@ -1449,7 +1447,7 @@ public class Sketch {
|
|||||||
protected void size(String buildPath, String suggestedClassName)
|
protected void size(String buildPath, String suggestedClassName)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
long size = 0;
|
long size = 0;
|
||||||
long maxsize = Preferences.getInteger("boards." + Preferences.get("board") + ".upload.maximum_size");
|
long maxsize = Integer.parseInt(Base.getBoardPreferences().get("upload.maximum_size"));
|
||||||
Sizer sizer = new Sizer(buildPath, suggestedClassName);
|
Sizer sizer = new Sizer(buildPath, suggestedClassName);
|
||||||
try {
|
try {
|
||||||
size = sizer.computeSize();
|
size = sizer.computeSize();
|
||||||
|
@ -45,7 +45,8 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
public boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
public boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
this.verbose = verbose;
|
this.verbose = verbose;
|
||||||
String uploadUsing = Preferences.get("boards." + Preferences.get("board") + ".upload.using");
|
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
||||||
|
String uploadUsing = boardPreferences.get("upload.using");
|
||||||
if (uploadUsing == null) {
|
if (uploadUsing == null) {
|
||||||
// fall back on global preference
|
// fall back on global preference
|
||||||
uploadUsing = Preferences.get("upload.using");
|
uploadUsing = Preferences.get("upload.using");
|
||||||
@ -53,7 +54,8 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
if (uploadUsing.equals("bootloader")) {
|
if (uploadUsing.equals("bootloader")) {
|
||||||
return uploadViaBootloader(buildPath, className);
|
return uploadViaBootloader(buildPath, className);
|
||||||
} else {
|
} else {
|
||||||
Collection params = getProgrammerCommands(uploadUsing);
|
// XXX: this needs to handle programmers in other targets.
|
||||||
|
Collection params = getProgrammerCommands(Base.getTarget().getName(), uploadUsing);
|
||||||
params.add("-Uflash:w:" + buildPath + File.separator + className + ".hex:i");
|
params.add("-Uflash:w:" + buildPath + File.separator + className + ".hex:i");
|
||||||
return avrdude(params);
|
return avrdude(params);
|
||||||
}
|
}
|
||||||
@ -61,65 +63,70 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
|
|
||||||
private boolean uploadViaBootloader(String buildPath, String className)
|
private boolean uploadViaBootloader(String buildPath, String className)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
|
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
||||||
List commandDownloader = new ArrayList();
|
List commandDownloader = new ArrayList();
|
||||||
String protocol = Preferences.get("boards." + Preferences.get("board") + ".upload.protocol");
|
String protocol = boardPreferences.get("upload.protocol");
|
||||||
|
|
||||||
// avrdude wants "stk500v1" to distinguish it from stk500v2
|
// avrdude wants "stk500v1" to distinguish it from stk500v2
|
||||||
if (protocol.equals("stk500"))
|
if (protocol.equals("stk500"))
|
||||||
protocol = "stk500v1";
|
protocol = "stk500v1";
|
||||||
commandDownloader.add("-c" + protocol);
|
commandDownloader.add("-c" + protocol);
|
||||||
commandDownloader.add("-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
|
|
||||||
commandDownloader.add(
|
commandDownloader.add(
|
||||||
"-b" + Preferences.getInteger("boards." + Preferences.get("board") + ".upload.speed"));
|
"-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
|
||||||
|
commandDownloader.add(
|
||||||
|
"-b" + Integer.parseInt(boardPreferences.get("upload.speed")));
|
||||||
commandDownloader.add("-D"); // don't erase
|
commandDownloader.add("-D"); // don't erase
|
||||||
commandDownloader.add("-Uflash:w:" + buildPath + File.separator + className + ".hex:i");
|
commandDownloader.add("-Uflash:w:" + buildPath + File.separator + className + ".hex:i");
|
||||||
|
|
||||||
if (Preferences.get("boards." + Preferences.get("board") + ".upload.disable_flushing") == null ||
|
if (boardPreferences.get("upload.disable_flushing") == null ||
|
||||||
Preferences.getBoolean("boards." + Preferences.get("board") + ".upload.disable_flushing") == false) {
|
boardPreferences.get("upload.disable_flushing").toLowerCase().equals("false")) {
|
||||||
flushSerialBuffer();
|
flushSerialBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
return avrdude(commandDownloader);
|
return avrdude(commandDownloader);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean burnBootloader(String programmer) throws RunnerException {
|
public boolean burnBootloader(String target, String programmer) throws RunnerException {
|
||||||
return burnBootloader(getProgrammerCommands(programmer));
|
return burnBootloader(getProgrammerCommands(target, programmer));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection getProgrammerCommands(String programmer) {
|
private Collection getProgrammerCommands(String targetName, String programmer) {
|
||||||
|
Target target = Base.targetsTable.get(targetName);
|
||||||
|
Map<String, String> programmerPreferences = target.getProgrammers().get(programmer);
|
||||||
List params = new ArrayList();
|
List params = new ArrayList();
|
||||||
params.add("-c" + Preferences.get("programmers." + programmer + ".protocol"));
|
params.add("-c" + programmerPreferences.get("protocol"));
|
||||||
|
|
||||||
if ("usb".equals(Preferences.get("programmers." + programmer + ".communication"))) {
|
if ("usb".equals(programmerPreferences.get("communication"))) {
|
||||||
params.add("-Pusb");
|
params.add("-Pusb");
|
||||||
} else if ("serial".equals(Preferences.get("programmers." + programmer + ".communication"))) {
|
} else if ("serial".equals(programmerPreferences.get("communication"))) {
|
||||||
params.add("-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
|
params.add("-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
|
||||||
if (Preferences.get("programmers." + programmer + ".speed") != null) {
|
if (programmerPreferences.get("speed") != null) {
|
||||||
params.add("-b" + Preferences.getInteger("programmers." + programmer + ".speed"));
|
params.add("-b" + Integer.parseInt(programmerPreferences.get("speed")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// XXX: add support for specifying the port address for parallel
|
// XXX: add support for specifying the port address for parallel
|
||||||
// programmers, although avrdude has a default that works in most cases.
|
// programmers, although avrdude has a default that works in most cases.
|
||||||
|
|
||||||
if (Preferences.get("programmers." + programmer + ".force") != null &&
|
if (programmerPreferences.get("force") != null &&
|
||||||
Preferences.getBoolean("programmers." + programmer + ".force"))
|
programmerPreferences.get("force").toLowerCase().equals("true"))
|
||||||
params.add("-F");
|
params.add("-F");
|
||||||
|
|
||||||
if (Preferences.get("programmers." + programmer + ".delay") != null)
|
if (programmerPreferences.get("delay") != null)
|
||||||
params.add("-i" + Preferences.get("programmers." + programmer + ".delay"));
|
params.add("-i" + programmerPreferences.get("delay"));
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean burnBootloader(Collection params)
|
protected boolean burnBootloader(Collection params)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
|
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
||||||
List fuses = new ArrayList();
|
List fuses = new ArrayList();
|
||||||
fuses.add("-e"); // erase the chip
|
fuses.add("-e"); // erase the chip
|
||||||
fuses.add("-Ulock:w:" + Preferences.get("boards." + Preferences.get("board") + ".bootloader.unlock_bits") + ":m");
|
fuses.add("-Ulock:w:" + boardPreferences.get("bootloader.unlock_bits") + ":m");
|
||||||
if (Preferences.get("boards." + Preferences.get("board") + ".bootloader.extended_fuses") != null)
|
if (boardPreferences.get("bootloader.extended_fuses") != null)
|
||||||
fuses.add("-Uefuse:w:" + Preferences.get("boards." + Preferences.get("board") + ".bootloader.extended_fuses") + ":m");
|
fuses.add("-Uefuse:w:" + boardPreferences.get("bootloader.extended_fuses") + ":m");
|
||||||
fuses.add("-Uhfuse:w:" + Preferences.get("boards." + Preferences.get("board") + ".bootloader.high_fuses") + ":m");
|
fuses.add("-Uhfuse:w:" + boardPreferences.get("bootloader.high_fuses") + ":m");
|
||||||
fuses.add("-Ulfuse:w:" + Preferences.get("boards." + Preferences.get("board") + ".bootloader.low_fuses") + ":m");
|
fuses.add("-Ulfuse:w:" + boardPreferences.get("bootloader.low_fuses") + ":m");
|
||||||
|
|
||||||
if (!avrdude(params, fuses))
|
if (!avrdude(params, fuses))
|
||||||
return false;
|
return false;
|
||||||
@ -128,11 +135,25 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
|
Target t;
|
||||||
|
String bootloaderPath = boardPreferences.get("bootloader.path");
|
||||||
|
|
||||||
|
if (bootloaderPath.indexOf(':') == -1) {
|
||||||
|
t = Base.getTarget(); // the current target (associated with the board)
|
||||||
|
} else {
|
||||||
|
String targetName = bootloaderPath.substring(0, bootloaderPath.indexOf(':'));
|
||||||
|
t = Base.targetsTable.get(targetName);
|
||||||
|
bootloaderPath = bootloaderPath.substring(bootloaderPath.indexOf(':') + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
File bootloadersFile = new File(t.getFolder(), "bootloaders");
|
||||||
|
File bootloaderFile = new File(bootloadersFile, bootloaderPath);
|
||||||
|
bootloaderPath = bootloaderFile.getAbsolutePath();
|
||||||
|
|
||||||
List bootloader = new ArrayList();
|
List bootloader = new ArrayList();
|
||||||
bootloader.add("-Uflash:w:" + Base.getHardwarePath() + File.separator + "bootloaders" + File.separator +
|
bootloader.add("-Uflash:w:" + bootloaderPath + File.separator +
|
||||||
Preferences.get("boards." + Preferences.get("board") + ".bootloader.path") +
|
boardPreferences.get("bootloader.file") + ":i");
|
||||||
File.separator + Preferences.get("boards." + Preferences.get("board") + ".bootloader.file") + ":i");
|
bootloader.add("-Ulock:w:" + boardPreferences.get("bootloader.lock_bits") + ":m");
|
||||||
bootloader.add("-Ulock:w:" + Preferences.get("boards." + Preferences.get("board") + ".bootloader.lock_bits") + ":m");
|
|
||||||
|
|
||||||
return avrdude(params, bootloader);
|
return avrdude(params, bootloader);
|
||||||
}
|
}
|
||||||
@ -165,7 +186,7 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
commandDownloader.add("-q");
|
commandDownloader.add("-q");
|
||||||
commandDownloader.add("-q");
|
commandDownloader.add("-q");
|
||||||
}
|
}
|
||||||
commandDownloader.add("-p" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"));
|
commandDownloader.add("-p" + Base.getBoardPreferences().get("build.mcu"));
|
||||||
commandDownloader.addAll(params);
|
commandDownloader.addAll(params);
|
||||||
|
|
||||||
return executeUploadCommand(commandDownloader);
|
return executeUploadCommand(commandDownloader);
|
||||||
|
@ -36,7 +36,7 @@ import java.util.zip.*;
|
|||||||
|
|
||||||
public class Compiler implements MessageConsumer {
|
public class Compiler implements MessageConsumer {
|
||||||
static final String BUGS_URL =
|
static final String BUGS_URL =
|
||||||
"https://developer.berlios.de/bugs/?group_id=3590";
|
"http://code.google.com/p/arduino/issues/list";
|
||||||
static final String SUPER_BADNESS =
|
static final String SUPER_BADNESS =
|
||||||
"Compiler error, please submit this code to " + BUGS_URL;
|
"Compiler error, please submit this code to " + BUGS_URL;
|
||||||
|
|
||||||
@ -55,14 +55,12 @@ public class Compiler implements MessageConsumer {
|
|||||||
* @param sketch Sketch object to be compiled.
|
* @param sketch Sketch object to be compiled.
|
||||||
* @param buildPath Where the temporary files live and will be built from.
|
* @param buildPath Where the temporary files live and will be built from.
|
||||||
* @param primaryClassName the name of the combined sketch file w/ extension
|
* @param primaryClassName the name of the combined sketch file w/ extension
|
||||||
* @param target the target (core) to build against
|
|
||||||
* @return true if successful.
|
* @return true if successful.
|
||||||
* @throws RunnerException Only if there's a problem. Only then.
|
* @throws RunnerException Only if there's a problem. Only then.
|
||||||
*/
|
*/
|
||||||
public boolean compile(Sketch sketch,
|
public boolean compile(Sketch sketch,
|
||||||
String buildPath,
|
String buildPath,
|
||||||
String primaryClassName,
|
String primaryClassName,
|
||||||
Target target,
|
|
||||||
boolean verbose) throws RunnerException {
|
boolean verbose) throws RunnerException {
|
||||||
this.sketch = sketch;
|
this.sketch = sketch;
|
||||||
this.buildPath = buildPath;
|
this.buildPath = buildPath;
|
||||||
@ -73,22 +71,37 @@ public class Compiler implements MessageConsumer {
|
|||||||
MessageStream pms = new MessageStream(this);
|
MessageStream pms = new MessageStream(this);
|
||||||
|
|
||||||
String avrBasePath = Base.getAvrBasePath();
|
String avrBasePath = Base.getAvrBasePath();
|
||||||
|
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
||||||
|
String core = boardPreferences.get("build.core");
|
||||||
|
String corePath;
|
||||||
|
|
||||||
|
if (core.indexOf(':') == -1) {
|
||||||
|
Target t = Base.getTarget();
|
||||||
|
File coreFolder = new File(new File(t.getFolder(), "cores"), core);
|
||||||
|
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));
|
||||||
|
corePath = coreFolder.getAbsolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
List<File> objectFiles = new ArrayList<File>();
|
List<File> objectFiles = new ArrayList<File>();
|
||||||
|
|
||||||
List includePaths = new ArrayList();
|
List includePaths = new ArrayList();
|
||||||
includePaths.add(target.getPath());
|
includePaths.add(corePath);
|
||||||
|
|
||||||
String runtimeLibraryName = buildPath + File.separator + "core.a";
|
String runtimeLibraryName = buildPath + File.separator + "core.a";
|
||||||
|
|
||||||
// 1. compile the target (core), outputting .o files to <buildPath> and
|
// 1. compile the core, outputting .o files to <buildPath> and then
|
||||||
// then collecting them into the core.a library file.
|
// collecting them into the core.a library file.
|
||||||
|
|
||||||
List<File> targetObjectFiles =
|
List<File> coreObjectFiles =
|
||||||
compileFiles(avrBasePath, buildPath, includePaths,
|
compileFiles(avrBasePath, buildPath, includePaths,
|
||||||
findFilesInPath(target.getPath(), "S", true),
|
findFilesInPath(corePath, "S", true),
|
||||||
findFilesInPath(target.getPath(), "c", true),
|
findFilesInPath(corePath, "c", true),
|
||||||
findFilesInPath(target.getPath(), "cpp", true));
|
findFilesInPath(corePath, "cpp", true),
|
||||||
|
boardPreferences);
|
||||||
|
|
||||||
List baseCommandAR = new ArrayList(Arrays.asList(new String[] {
|
List baseCommandAR = new ArrayList(Arrays.asList(new String[] {
|
||||||
avrBasePath + "avr-ar",
|
avrBasePath + "avr-ar",
|
||||||
@ -96,7 +109,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
runtimeLibraryName
|
runtimeLibraryName
|
||||||
}));
|
}));
|
||||||
|
|
||||||
for(File file : targetObjectFiles) {
|
for(File file : coreObjectFiles) {
|
||||||
List commandAR = new ArrayList(baseCommandAR);
|
List commandAR = new ArrayList(baseCommandAR);
|
||||||
commandAR.add(file.getAbsolutePath());
|
commandAR.add(file.getAbsolutePath());
|
||||||
execAsynchronously(commandAR);
|
execAsynchronously(commandAR);
|
||||||
@ -111,21 +124,24 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
for (File libraryFolder : sketch.getImportedLibraries()) {
|
for (File libraryFolder : sketch.getImportedLibraries()) {
|
||||||
File outputFolder = new File(buildPath, libraryFolder.getName());
|
File outputFolder = new File(buildPath, libraryFolder.getName());
|
||||||
|
File utilityFolder = new File(libraryFolder, "utility");
|
||||||
createFolder(outputFolder);
|
createFolder(outputFolder);
|
||||||
// this library can use includes in its utility/ folder
|
// this library can use includes in its utility/ folder
|
||||||
includePaths.add(libraryFolder.getPath() + File.separator + "utility");
|
includePaths.add(utilityFolder.getAbsolutePath());
|
||||||
objectFiles.addAll(
|
objectFiles.addAll(
|
||||||
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
|
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
|
||||||
findFilesInFolder(libraryFolder, "S", false),
|
findFilesInFolder(libraryFolder, "S", false),
|
||||||
findFilesInFolder(libraryFolder, "c", false),
|
findFilesInFolder(libraryFolder, "c", false),
|
||||||
findFilesInFolder(libraryFolder, "cpp", false)));
|
findFilesInFolder(libraryFolder, "cpp", false),
|
||||||
|
boardPreferences));
|
||||||
outputFolder = new File(outputFolder, "utility");
|
outputFolder = new File(outputFolder, "utility");
|
||||||
createFolder(outputFolder);
|
createFolder(outputFolder);
|
||||||
objectFiles.addAll(
|
objectFiles.addAll(
|
||||||
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
|
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
|
||||||
findFilesInFolder(new File(libraryFolder, "utility"), "S", false),
|
findFilesInFolder(utilityFolder, "S", false),
|
||||||
findFilesInFolder(new File(libraryFolder, "utility"), "c", false),
|
findFilesInFolder(utilityFolder, "c", false),
|
||||||
findFilesInFolder(new File(libraryFolder, "utility"), "cpp", false)));
|
findFilesInFolder(utilityFolder, "cpp", false),
|
||||||
|
boardPreferences));
|
||||||
// other libraries should not see this library's utility/ folder
|
// other libraries should not see this library's utility/ folder
|
||||||
includePaths.remove(includePaths.size() - 1);
|
includePaths.remove(includePaths.size() - 1);
|
||||||
}
|
}
|
||||||
@ -136,7 +152,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
compileFiles(avrBasePath, buildPath, includePaths,
|
compileFiles(avrBasePath, buildPath, includePaths,
|
||||||
findFilesInPath(buildPath, "S", false),
|
findFilesInPath(buildPath, "S", false),
|
||||||
findFilesInPath(buildPath, "c", false),
|
findFilesInPath(buildPath, "c", false),
|
||||||
findFilesInPath(buildPath, "cpp", false)));
|
findFilesInPath(buildPath, "cpp", false),
|
||||||
|
boardPreferences));
|
||||||
|
|
||||||
// 4. link it all together into the .elf file
|
// 4. link it all together into the .elf file
|
||||||
|
|
||||||
@ -144,7 +161,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
avrBasePath + "avr-gcc",
|
avrBasePath + "avr-gcc",
|
||||||
"-Os",
|
"-Os",
|
||||||
"-Wl,--gc-sections",
|
"-Wl,--gc-sections",
|
||||||
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
|
"-mmcu=" + boardPreferences.get("build.mcu"),
|
||||||
"-o",
|
"-o",
|
||||||
buildPath + File.separator + primaryClassName + ".elf"
|
buildPath + File.separator + primaryClassName + ".elf"
|
||||||
}));
|
}));
|
||||||
@ -195,7 +212,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
private List<File> compileFiles(String avrBasePath,
|
private List<File> compileFiles(String avrBasePath,
|
||||||
String buildPath, List<File> includePaths,
|
String buildPath, List<File> includePaths,
|
||||||
List<File> sSources,
|
List<File> sSources,
|
||||||
List<File> cSources, List<File> cppSources)
|
List<File> cSources, List<File> cppSources,
|
||||||
|
Map<String, String> boardPreferences)
|
||||||
throws RunnerException {
|
throws RunnerException {
|
||||||
|
|
||||||
List<File> objectPaths = new ArrayList<File>();
|
List<File> objectPaths = new ArrayList<File>();
|
||||||
@ -205,7 +223,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
objectPaths.add(new File(objectPath));
|
objectPaths.add(new File(objectPath));
|
||||||
execAsynchronously(getCommandCompilerS(avrBasePath, includePaths,
|
execAsynchronously(getCommandCompilerS(avrBasePath, includePaths,
|
||||||
file.getAbsolutePath(),
|
file.getAbsolutePath(),
|
||||||
objectPath));
|
objectPath,
|
||||||
|
boardPreferences));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (File file : cSources) {
|
for (File file : cSources) {
|
||||||
@ -213,7 +232,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
objectPaths.add(new File(objectPath));
|
objectPaths.add(new File(objectPath));
|
||||||
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
|
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
|
||||||
file.getAbsolutePath(),
|
file.getAbsolutePath(),
|
||||||
objectPath));
|
objectPath,
|
||||||
|
boardPreferences));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (File file : cppSources) {
|
for (File file : cppSources) {
|
||||||
@ -221,7 +241,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
objectPaths.add(new File(objectPath));
|
objectPaths.add(new File(objectPath));
|
||||||
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
|
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
|
||||||
file.getAbsolutePath(),
|
file.getAbsolutePath(),
|
||||||
objectPath));
|
objectPath,
|
||||||
|
boardPreferences));
|
||||||
}
|
}
|
||||||
|
|
||||||
return objectPaths;
|
return objectPaths;
|
||||||
@ -320,7 +341,9 @@ public class Compiler implements MessageConsumer {
|
|||||||
// attemping to compare
|
// attemping to compare
|
||||||
//
|
//
|
||||||
//String buildPathSubst = buildPath.replace(File.separatorChar, '/') + "/";
|
//String buildPathSubst = buildPath.replace(File.separatorChar, '/') + "/";
|
||||||
String buildPathSubst = buildPath.replace(File.separatorChar,File.separatorChar) + File.separatorChar;
|
String buildPathSubst =
|
||||||
|
buildPath.replace(File.separatorChar,File.separatorChar) +
|
||||||
|
File.separatorChar;
|
||||||
|
|
||||||
String partialTempPath = null;
|
String partialTempPath = null;
|
||||||
int partialStartIndex = -1; //s.indexOf(partialTempPath);
|
int partialStartIndex = -1; //s.indexOf(partialTempPath);
|
||||||
@ -444,14 +467,14 @@ public class Compiler implements MessageConsumer {
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static private List getCommandCompilerS(String avrBasePath, List includePaths,
|
static private List getCommandCompilerS(String avrBasePath, List includePaths,
|
||||||
String sourceName, String objectName) {
|
String sourceName, String objectName, Map<String, String> boardPreferences) {
|
||||||
List baseCommandCompiler = new ArrayList(Arrays.asList(new String[] {
|
List baseCommandCompiler = new ArrayList(Arrays.asList(new String[] {
|
||||||
avrBasePath + "avr-gcc",
|
avrBasePath + "avr-gcc",
|
||||||
"-c", // compile, don't link
|
"-c", // compile, don't link
|
||||||
"-g", // include debugging info (so errors include line numbers)
|
"-g", // include debugging info (so errors include line numbers)
|
||||||
"-assembler-with-cpp",
|
"-assembler-with-cpp",
|
||||||
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
|
"-mmcu=" + boardPreferences.get("build.mcu"),
|
||||||
"-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"),
|
"-DF_CPU=" + boardPreferences.get("build.f_cpu"),
|
||||||
"-DARDUINO=" + Base.REVISION,
|
"-DARDUINO=" + Base.REVISION,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -467,7 +490,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
|
|
||||||
static private List getCommandCompilerC(String avrBasePath, List includePaths,
|
static private List getCommandCompilerC(String avrBasePath, List includePaths,
|
||||||
String sourceName, String objectName) {
|
String sourceName, String objectName, Map<String, String> boardPreferences) {
|
||||||
|
|
||||||
List baseCommandCompiler = new ArrayList(Arrays.asList(new String[] {
|
List baseCommandCompiler = new ArrayList(Arrays.asList(new String[] {
|
||||||
avrBasePath + "avr-gcc",
|
avrBasePath + "avr-gcc",
|
||||||
@ -477,8 +500,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
"-w", // surpress all warnings
|
"-w", // surpress all warnings
|
||||||
"-ffunction-sections", // place each function in its own section
|
"-ffunction-sections", // place each function in its own section
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
|
"-mmcu=" + boardPreferences.get("build.mcu"),
|
||||||
"-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"),
|
"-DF_CPU=" + boardPreferences.get("build.f_cpu"),
|
||||||
"-DARDUINO=" + Base.REVISION,
|
"-DARDUINO=" + Base.REVISION,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -494,7 +517,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
|
|
||||||
static private List getCommandCompilerCPP(String avrBasePath,
|
static private List getCommandCompilerCPP(String avrBasePath,
|
||||||
List includePaths, String sourceName, String objectName) {
|
List includePaths, String sourceName, String objectName,
|
||||||
|
Map<String, String> boardPreferences) {
|
||||||
|
|
||||||
List baseCommandCompilerCPP = new ArrayList(Arrays.asList(new String[] {
|
List baseCommandCompilerCPP = new ArrayList(Arrays.asList(new String[] {
|
||||||
avrBasePath + "avr-g++",
|
avrBasePath + "avr-g++",
|
||||||
@ -505,8 +529,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
"-fno-exceptions",
|
"-fno-exceptions",
|
||||||
"-ffunction-sections", // place each function in its own section
|
"-ffunction-sections", // place each function in its own section
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
|
"-mmcu=" + boardPreferences.get("build.mcu"),
|
||||||
"-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"),
|
"-DF_CPU=" + boardPreferences.get("build.f_cpu"),
|
||||||
"-DARDUINO=" + Base.REVISION,
|
"-DARDUINO=" + Base.REVISION,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Target - represents a target platform
|
Target - represents a hardware platform
|
||||||
Part of the Arduino project - http://arduino.berlios.de/
|
Part of the Arduino project - http://www.arduino.cc/
|
||||||
|
|
||||||
Copyright (c) 2005
|
Copyright (c) 2009 David A. Mellis
|
||||||
David A. Mellis
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -21,59 +20,72 @@
|
|||||||
along with this program; if not, write to the Free Software Foundation,
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
$Id: Target.java 85 2006-01-12 23:24:12Z mellis $
|
$Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package processing.app.debug;
|
package processing.app.debug;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
import processing.app.Preferences;
|
||||||
* Represents a target platform (e.g. Wiring board, Arduino board).
|
|
||||||
*/
|
|
||||||
public class Target {
|
public class Target {
|
||||||
String path;
|
private String name;
|
||||||
List sources = new ArrayList();
|
private File folder;
|
||||||
List objects = new ArrayList();
|
private Map boards;
|
||||||
|
private Map programmers;
|
||||||
|
|
||||||
/**
|
public Target(String name, File folder) {
|
||||||
* Create a Target.
|
this.name = name;
|
||||||
* @param path the directory containing config, source, and object files for
|
this.folder = folder;
|
||||||
* the target platform.
|
this.boards = new LinkedHashMap();
|
||||||
*/
|
this.programmers = new LinkedHashMap();
|
||||||
public Target(String base, String target) throws IOException {
|
|
||||||
path = base + File.separator + target;
|
|
||||||
String[] files = (new File(path)).list();
|
|
||||||
|
|
||||||
if (files == null)
|
File boardsFile = new File(folder, "boards.txt");
|
||||||
throw new IOException("Target platform: \"" + target + "\" not found.\n" +
|
try {
|
||||||
"Make sure that \"build.target\" in the \n" +
|
if (boardsFile.exists()) {
|
||||||
"preferences file points to a subdirectory of \n" +
|
Map boardPreferences = new LinkedHashMap();
|
||||||
base);
|
Preferences.load(new FileInputStream(boardsFile), boardPreferences);
|
||||||
|
for (Object k : boardPreferences.keySet()) {
|
||||||
|
String key = (String) k;
|
||||||
|
String board = key.substring(0, key.indexOf('.'));
|
||||||
|
if (!boards.containsKey(board)) boards.put(board, new HashMap());
|
||||||
|
((Map) boards.get(board)).put(
|
||||||
|
key.substring(key.indexOf('.') + 1),
|
||||||
|
boardPreferences.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Error loading boards from " + boardsFile + ": " + e);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < files.length; i++) {
|
File programmersFile = new File(folder, "programmers.txt");
|
||||||
if (files[i].endsWith(".S") || files[i].endsWith(".c") || files[i].endsWith(".cpp"))
|
try {
|
||||||
sources.add(files[i]);
|
if (programmersFile.exists()) {
|
||||||
if (files[i].endsWith(".o"))
|
Map programmerPreferences = new LinkedHashMap();
|
||||||
objects.add(files[i]);
|
Preferences.load(new FileInputStream(programmersFile), programmerPreferences);
|
||||||
|
for (Object k : programmerPreferences.keySet()) {
|
||||||
|
String key = (String) k;
|
||||||
|
String programmer = key.substring(0, key.indexOf('.'));
|
||||||
|
if (!programmers.containsKey(programmer)) programmers.put(programmer, new HashMap());
|
||||||
|
((Map) programmers.get(programmer)).put(
|
||||||
|
key.substring(key.indexOf('.') + 1),
|
||||||
|
programmerPreferences.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Error loading programmers from " +
|
||||||
|
programmersFile + ": " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPath() { return path; }
|
public String getName() { return name; }
|
||||||
|
public File getFolder() { return folder; }
|
||||||
/**
|
public Map<String, Map<String, String>> getBoards() {
|
||||||
* The source files in the library for the target platform.
|
return boards;
|
||||||
* @return A read-only collection of strings containing the name of each source file.
|
|
||||||
*/
|
|
||||||
public Collection getSourceFilenames() {
|
|
||||||
return Collections.unmodifiableList(sources);
|
|
||||||
}
|
}
|
||||||
|
public Map<String, Map<String, String>> getProgrammers() {
|
||||||
/**
|
return programmers;
|
||||||
* The object files in the library for the target platform.
|
|
||||||
* @return A read-only collection of strings containing the name of each object file.
|
|
||||||
*/
|
|
||||||
public Collection getObjectFilenames() {
|
|
||||||
return Collections.unmodifiableList(objects);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -65,7 +65,7 @@ public abstract class Uploader implements MessageConsumer {
|
|||||||
public abstract boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
public abstract boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
||||||
throws RunnerException;
|
throws RunnerException;
|
||||||
|
|
||||||
public abstract boolean burnBootloader(String programmer) throws RunnerException;
|
public abstract boolean burnBootloader(String target, String programmer) throws RunnerException;
|
||||||
|
|
||||||
protected void flushSerialBuffer() throws RunnerException {
|
protected void flushSerialBuffer() throws RunnerException {
|
||||||
// Cleanup the serial buffer
|
// Cleanup the serial buffer
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
package processing.app.preproc;
|
package processing.app.preproc;
|
||||||
|
|
||||||
import processing.app.*;
|
import processing.app.*;
|
||||||
import processing.app.debug.Target;
|
|
||||||
import processing.core.*;
|
import processing.core.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -50,7 +49,6 @@ public class PdePreprocessor {
|
|||||||
// we always write one header: WProgram.h
|
// we always write one header: WProgram.h
|
||||||
public int headerCount = 1;
|
public int headerCount = 1;
|
||||||
|
|
||||||
Target target;
|
|
||||||
List prototypes;
|
List prototypes;
|
||||||
|
|
||||||
|
|
||||||
@ -82,12 +80,10 @@ public class PdePreprocessor {
|
|||||||
public PdePreprocessor() { }
|
public PdePreprocessor() { }
|
||||||
|
|
||||||
public int writePrefix(String program, String buildPath,
|
public int writePrefix(String program, String buildPath,
|
||||||
String name, String codeFolderPackages[],
|
String name, String codeFolderPackages[])
|
||||||
Target target)
|
|
||||||
throws FileNotFoundException {
|
throws FileNotFoundException {
|
||||||
this.buildPath = buildPath;
|
this.buildPath = buildPath;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.target = target;
|
|
||||||
|
|
||||||
int tabSize = Preferences.getInteger("editor.tabs.size");
|
int tabSize = Preferences.getInteger("editor.tabs.size");
|
||||||
char[] indentChars = new char[tabSize];
|
char[] indentChars = new char[tabSize];
|
||||||
@ -196,7 +192,7 @@ public class PdePreprocessor {
|
|||||||
// String extraImports[]) throws java.lang.Exception {
|
// String extraImports[]) throws java.lang.Exception {
|
||||||
public String write() throws java.lang.Exception {
|
public String write() throws java.lang.Exception {
|
||||||
writeProgram(stream, program, prototypes);
|
writeProgram(stream, program, prototypes);
|
||||||
writeFooter(stream, target);
|
writeFooter(stream);
|
||||||
stream.close();
|
stream.close();
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
@ -223,23 +219,7 @@ public class PdePreprocessor {
|
|||||||
*
|
*
|
||||||
* @param out PrintStream to write it to.
|
* @param out PrintStream to write it to.
|
||||||
*/
|
*/
|
||||||
protected void writeFooter(PrintStream out, Target target) throws java.lang.Exception {
|
protected void writeFooter(PrintStream out) throws java.lang.Exception {}
|
||||||
// Open the file main.cxx and copy its entire contents to the bottom of the
|
|
||||||
// generated sketch .cpp file...
|
|
||||||
|
|
||||||
String mainFileName = target.getPath() + File.separator + "main.cxx";
|
|
||||||
FileReader reader = null;
|
|
||||||
reader = new FileReader(mainFileName);
|
|
||||||
|
|
||||||
LineNumberReader mainfile = new LineNumberReader(reader);
|
|
||||||
|
|
||||||
String line;
|
|
||||||
while ((line = mainfile.readLine()) != null) {
|
|
||||||
out.print(line + "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
mainfile.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<String> getExtraImports() {
|
public ArrayList<String> getExtraImports() {
|
||||||
|
@ -36,7 +36,7 @@ else
|
|||||||
chmod +x work/Arduino.app/Contents/MacOS/JavaApplicationStub
|
chmod +x work/Arduino.app/Contents/MacOS/JavaApplicationStub
|
||||||
|
|
||||||
cp -rX ../shared/lib "$RESOURCES/"
|
cp -rX ../shared/lib "$RESOURCES/"
|
||||||
cp -rX ../shared/libraries "$RESOURCES/"
|
cp -rX ../../libraries "$RESOURCES/"
|
||||||
cp -rX ../shared/tools "$RESOURCES/"
|
cp -rX ../shared/tools "$RESOURCES/"
|
||||||
|
|
||||||
cp -rX ../../hardware "$RESOURCES/"
|
cp -rX ../../hardware "$RESOURCES/"
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
// 2-dimensional array of row pin numbers:
|
// 2-dimensional array of row pin numbers:
|
||||||
const int row[8] = {
|
const int row[8] = {
|
||||||
2,7,19,5,18,12,16 };
|
2,7,19,5,13,18,12,16 };
|
||||||
|
|
||||||
// 2-dimensional array of column pin numbers:
|
// 2-dimensional array of column pin numbers:
|
||||||
const int col[8] = {
|
const int col[8] = {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include <WProgram.h>
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
pin_atmega8.c - pin definitions for the atmega8
|
|
||||||
Part of Arduino / Wiring Lite
|
|
||||||
|
|
||||||
Copyright (c) 2005 David A. Mellis
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General
|
|
||||||
Public License along with this library; if not, write to the
|
|
||||||
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
||||||
Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include "wiring.h"
|
|
||||||
|
|
||||||
// We map the pin numbers passed to digitalRead() or
|
|
||||||
// analogRead() directly to the corresponding pin
|
|
||||||
// numbers on the Atmega8. No distinction is made
|
|
||||||
// between analog and digital pins.
|
|
||||||
|
|
||||||
// ATMEL ATMEGA8
|
|
||||||
//
|
|
||||||
// +-\/-+
|
|
||||||
// PC6 1| |28 PC5
|
|
||||||
// PD0 2| |27 PC4
|
|
||||||
// PD1 3| |26 PC3
|
|
||||||
// PD2 4| |25 PC2
|
|
||||||
// PD3 5| |24 PC1
|
|
||||||
// PD4 6| |23 PC0
|
|
||||||
// VCC 7| |22 GND
|
|
||||||
// GND 8| |21 AREF
|
|
||||||
// PB6 9| |20 AVCC
|
|
||||||
// PB7 10| |19 PB5
|
|
||||||
// PD5 11| |18 PB4
|
|
||||||
// PD6 12| |17 PB3
|
|
||||||
// PD7 13| |16 PB2
|
|
||||||
// PB0 14| |15 PB1
|
|
||||||
// +----+
|
|
||||||
|
|
||||||
#define NUM_PINS 28
|
|
||||||
#define NUM_PORTS 4
|
|
||||||
|
|
||||||
#define PB 2
|
|
||||||
#define PC 3
|
|
||||||
#define PD 4
|
|
||||||
|
|
||||||
int port_to_mode[NUM_PORTS + 1] = {
|
|
||||||
NOT_A_PORT,
|
|
||||||
NOT_A_PORT,
|
|
||||||
_SFR_IO_ADDR(DDRB),
|
|
||||||
_SFR_IO_ADDR(DDRC),
|
|
||||||
_SFR_IO_ADDR(DDRD),
|
|
||||||
};
|
|
||||||
|
|
||||||
int port_to_output[NUM_PORTS + 1] = {
|
|
||||||
NOT_A_PORT,
|
|
||||||
NOT_A_PORT,
|
|
||||||
_SFR_IO_ADDR(PORTB),
|
|
||||||
_SFR_IO_ADDR(PORTC),
|
|
||||||
_SFR_IO_ADDR(PORTD),
|
|
||||||
};
|
|
||||||
|
|
||||||
int port_to_input[NUM_PORTS + 1] = {
|
|
||||||
NOT_A_PORT,
|
|
||||||
NOT_A_PORT,
|
|
||||||
_SFR_IO_ADDR(PINB),
|
|
||||||
_SFR_IO_ADDR(PINC),
|
|
||||||
_SFR_IO_ADDR(PIND),
|
|
||||||
};
|
|
||||||
|
|
||||||
pin_t digital_pin_to_port_array[] = {
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
|
|
||||||
{ PC, 6 },
|
|
||||||
{ PD, 0 },
|
|
||||||
{ PD, 1 },
|
|
||||||
{ PD, 2 },
|
|
||||||
{ PD, 3 },
|
|
||||||
{ PD, 4 },
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
{ PB, 6 },
|
|
||||||
{ PB, 7 },
|
|
||||||
{ PD, 5 },
|
|
||||||
{ PD, 6 },
|
|
||||||
{ PD, 7 },
|
|
||||||
{ PB, 0 },
|
|
||||||
|
|
||||||
{ PB, 1 },
|
|
||||||
{ PB, 2 },
|
|
||||||
{ PB, 3 },
|
|
||||||
{ PB, 4 },
|
|
||||||
{ PB, 5 },
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
{ NOT_A_PIN, NOT_A_PIN },
|
|
||||||
{ PC, 0 },
|
|
||||||
{ PC, 1 },
|
|
||||||
{ PC, 2 },
|
|
||||||
{ PC, 3 },
|
|
||||||
{ PC, 4 },
|
|
||||||
{ PC, 5 },
|
|
||||||
};
|
|
||||||
|
|
||||||
pin_t *digital_pin_to_port = digital_pin_to_port_array;
|
|
||||||
pin_t *analog_in_pin_to_port = digital_pin_to_port_array;
|
|
||||||
pin_t *analog_out_pin_to_port = digital_pin_to_port_array;
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user