Dukebats / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Programmer Speed setting is ignored when USB port is used. #1087

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a speed setting for a programmer in the hardware/programmers.txt file 
2. upload a sketch using the programmer
3. see that the speed is totally ignored for USB programmers

What is the expected output? What do you see instead?
apply the -b setting to Avrdude no matter if usb or serial programmers are used.

What version of the Arduino software are you using? 1.0.1
On what operating system?  Mac
Which Arduino board are you using? Uno, NG, ProNano, custom

Please provide any additional information below.
Here is the source in AvrdudeUploader.java that shows the ignored -b parameter 
for USB based programmers:

private Collection getProgrammerCommands(Target target, String programmer) {
    Map<String, String> programmerPreferences = target.getProgrammers().get(programmer);
    List params = new ArrayList();
    params.add("-c" + programmerPreferences.get("protocol"));

    if ("usb".equals(programmerPreferences.get("communication"))) {
      params.add("-Pusb");
    } else if ("serial".equals(programmerPreferences.get("communication"))) {
      params.add("-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
      if (programmerPreferences.get("speed") != null) {
        params.add("-b" + Integer.parseInt(programmerPreferences.get("speed")));
      }
    }

Original issue reported on code.google.com by w...@wolfpaulus.com on 29 Oct 2012 at 3:37