From ce486515297e13c203aab5ec6ecb61099da260f0 Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Tue, 18 Jun 2013 15:33:28 +0100 Subject: [PATCH 1/2] Added raspberry pi targets Former-commit-id: 3510fc02f046da90a3a12df9b490840a716c4616 --- app/src/processing/app/Base.java | 6 + .../processing/app/debug/AvrdudeUploader.java | 25 +-- build/build.xml | 152 +++++++++++++++++- build/raspberrypi/dist/lib/.gitplaceholder | 0 4 files changed, 172 insertions(+), 11 deletions(-) create mode 100644 build/raspberrypi/dist/lib/.gitplaceholder diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 34087198d..c32f41e99 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -196,6 +196,7 @@ static protected boolean isCommandLine() { static protected void initPlatform() { + logger.debug("Platform and arch: " + osName()); try { Class platformClass = Class.forName("processing.app.Platform"); if (Base.isMacOS()) { @@ -1469,6 +1470,11 @@ static public int getPlatformIndex(String what) { // of conflicts that could happen with older versions of core.jar, where // the MACOSX constant would instead read as the LINUX constant. + static public String osName() { + String sysname = getPlatformName(); + String arch = System.getProperty("os.arch");; + return sysname + "_" + arch; + } /** * returns true if Processing is running on a Mac OS X machine. diff --git a/app/src/processing/app/debug/AvrdudeUploader.java b/app/src/processing/app/debug/AvrdudeUploader.java index d462d1eaf..6e4dee349 100755 --- a/app/src/processing/app/debug/AvrdudeUploader.java +++ b/app/src/processing/app/debug/AvrdudeUploader.java @@ -90,18 +90,21 @@ public boolean uploadUsingPreferences(String buildPath, String className, boolea List parts = new ArrayList(); String command = null; - if (Base.isLinux()) { - command = bootloader.get("command_linux"); - } - if (Base.isWindows()) { - command = bootloader.get("command_windows"); + + + // Let's find the right command to use - starting from the most specific + // (os and arch), then just the os, and finally the generic command. + + command = bootloader.get("command_" + Base.osName()); + if (command == null) { + command = bootloader.get("command_" + Base.getPlatformName()); } - if (Base.isMacOS()) { - command = bootloader.get("command_macosx"); + if (command == null) { + command = bootloader.get("command"); } - // If not got an OS specific entry, fall back to the generic one. if (command == null) { - command = bootloader.get("command"); + logger.debug("ERROR: No command found for bootloader!"); + return false; } logger.debug("================ UPLOAD ================="); @@ -112,7 +115,9 @@ public boolean uploadUsingPreferences(String buildPath, String className, boolea String[] spl = command.split("\\s+"); String executable = spl[0]; if (Base.isWindows()) { - executable = executable + ".exe"; + if (executable.indexOf(".exe") == -1) { + executable = executable + ".exe"; + } } String variant = boardPreferences.get("build.variant"); diff --git a/build/build.xml b/build/build.xml index 422c1e964..9ed45f64c 100755 --- a/build/build.xml +++ b/build/build.xml @@ -24,6 +24,9 @@ + + + @@ -368,6 +371,10 @@ + + + + ======================================================= @@ -415,6 +422,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -451,6 +504,42 @@ + + + + + + + + + + + + + + + + + + + + ======================================================= + mpide for Raspberry Pi was built. Grab the archive from + + build/raspberrypi/mpide-${version}.tgz + ======================================================= + + + @@ -494,6 +583,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Package: mpide +Version: ${version} +Maintainer: matt@majenko.co.uk +Architecture: armhf +Section: Programming +Depends: avr-libc, avrdude, binutils-avr, extra-xdg-menus, gcc-avr, libftdi1, libjna-java, librxtx-java +Description: chipKIT MPIDE Development environment + + + + + + + + + + ======================================================= + mpide for Raspberry Pi was built. Grab the package from + + build/raspberrypi/mpide-${version}.deb + ======================================================= + + + @@ -722,7 +872,7 @@ Description: chipKIT MPIDE Development environment + depends="linux-clean, windows-clean, macosx-clean, raspberrypi-clean, subprojects-clean"> diff --git a/build/raspberrypi/dist/lib/.gitplaceholder b/build/raspberrypi/dist/lib/.gitplaceholder new file mode 100644 index 000000000..e69de29bb From ca60b06104cf63dc33e9eca2862937548104bfde Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Tue, 25 Jun 2013 19:45:02 +0100 Subject: [PATCH 2/2] Added download to build.xml for pi compiler Former-commit-id: fe8dd436d02b4c769a95f5313f7de139b80d59b2 --- build/build.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/build.xml b/build/build.xml index 9ed45f64c..38f32930b 100755 --- a/build/build.xml +++ b/build/build.xml @@ -442,18 +442,17 @@ - - + usetimestamp="true"/> - + - +