Skip to content

Programmer Speed setting is ignored when USB port is used. [imported] #202

@cmaglie

Description

@cmaglie

This is Issue 1087 moved from a Google Code project.
Added by 2012-10-29T03:37:49.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

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")));
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions