mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-03 14:24:15 +01:00
Fallback on system avrdude if Arduino avrdude isn't present (Linux).
This commit is contained in:
parent
a6a1aca8a2
commit
c9d4630d2b
@ -176,14 +176,17 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
|
|
||||||
public boolean avrdude(Collection params) throws RunnerException {
|
public boolean avrdude(Collection params) throws RunnerException {
|
||||||
List commandDownloader = new ArrayList();
|
List commandDownloader = new ArrayList();
|
||||||
commandDownloader.add("avrdude");
|
|
||||||
|
|
||||||
// Point avrdude at its config file since it's in a non-standard location.
|
if(Base.isLinux()) {
|
||||||
if (Base.isLinux()) {
|
if ((new File(Base.getHardwarePath() + "/tools/" + "avrdude")).exists()) {
|
||||||
// ???: is it better to have Linux users install avrdude themselves, in
|
commandDownloader.add(Base.getHardwarePath() + "/tools/" + "avrdude");
|
||||||
// a way that it can find its own configuration file?
|
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
||||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
} else {
|
||||||
} else {
|
commandDownloader.add("avrdude");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
commandDownloader.add(Base.getHardwarePath() + "/tools/avr/bin/" + "avrdude");
|
||||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avr/etc/avrdude.conf");
|
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avr/etc/avrdude.conf");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,17 +114,6 @@ public abstract class Uploader implements MessageConsumer {
|
|||||||
String[] commandArray = new String[commandDownloader.size()];
|
String[] commandArray = new String[commandDownloader.size()];
|
||||||
commandDownloader.toArray(commandArray);
|
commandDownloader.toArray(commandArray);
|
||||||
|
|
||||||
String avrBasePath;
|
|
||||||
|
|
||||||
if(Base.isLinux()) {
|
|
||||||
avrBasePath = new String(Base.getHardwarePath() + "/tools/");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
avrBasePath = new String(Base.getHardwarePath() + "/tools/avr/bin/");
|
|
||||||
}
|
|
||||||
|
|
||||||
commandArray[0] = avrBasePath + commandArray[0];
|
|
||||||
|
|
||||||
if (verbose || Preferences.getBoolean("upload.verbose")) {
|
if (verbose || Preferences.getBoolean("upload.verbose")) {
|
||||||
for(int i = 0; i < commandArray.length; i++) {
|
for(int i = 0; i < commandArray.length; i++) {
|
||||||
System.out.print(commandArray[i] + " ");
|
System.out.print(commandArray[i] + " ");
|
||||||
|
Loading…
Reference in New Issue
Block a user