mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +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 {
|
||||
List commandDownloader = new ArrayList();
|
||||
commandDownloader.add("avrdude");
|
||||
|
||||
// Point avrdude at its config file since it's in a non-standard location.
|
||||
if (Base.isLinux()) {
|
||||
// ???: is it better to have Linux users install avrdude themselves, in
|
||||
// a way that it can find its own configuration file?
|
||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
||||
} else {
|
||||
|
||||
if(Base.isLinux()) {
|
||||
if ((new File(Base.getHardwarePath() + "/tools/" + "avrdude")).exists()) {
|
||||
commandDownloader.add(Base.getHardwarePath() + "/tools/" + "avrdude");
|
||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
||||
} else {
|
||||
commandDownloader.add("avrdude");
|
||||
}
|
||||
}
|
||||
else {
|
||||
commandDownloader.add(Base.getHardwarePath() + "/tools/avr/bin/" + "avrdude");
|
||||
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()];
|
||||
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")) {
|
||||
for(int i = 0; i < commandArray.length; i++) {
|
||||
System.out.print(commandArray[i] + " ");
|
||||
|
Loading…
Reference in New Issue
Block a user