Skip to content

Call on onBoardOrPortChange after selectBoard when board argument passed into command line #3759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2015

Conversation

sandeepmistry
Copy link
Contributor

Implements same behaviour as the GUI when a board is changed via the menu.

I was having issues with the build failing because the library path for previous architecture was used for bundled libraries like Wire.

Like GUI mode does when a board is changed.
@ffissore
Copy link
Contributor

ffissore commented Sep 2, 2015

Can you provide a sequence of steps for reproducing the issue?

@ffissore ffissore self-assigned this Sep 2, 2015
@ffissore ffissore added Component: Compilation Related to compilation of Arduino sketches Component: CLI The Arduino IDE's command line interface labels Sep 2, 2015
@ffissore ffissore added this to the Release 1.6.6 milestone Sep 2, 2015
@sandeepmistry
Copy link
Contributor Author

Steps to reproduce:

  1. Create WireTest sketch:
#include <Wire.h>

void setup() {
}

void loop() {
}
  1. Build for Uno
/Applications/Arduino.app/Contents/MacOS/Arduino --verbose-build --verify --board arduino:avr:uno ~/Documents/Arduino/WireTest/WireTest.ino
  1. Build for Due
/Applications/Arduino.app/Contents/MacOS/Arduino --verbose-build --verify --board arduino:sam:arduino_due_x_dbg ~/Documents/Arduino/WireTest/WireTest.ino

I get the following error:

/Users/smistry/Documents/Arduino/hardware/arduino/avr/libraries/Wire/Wire.cpp: In member function 'void TwoWire::setClock(uint32_t)':
/Users/smistry/Documents/Arduino/hardware/arduino/avr/libraries/Wire/Wire.cpp:85:3: error: 'TWBR' was not declared in this scope
   TWBR = ((F_CPU / frequency) - 16) / 2;
   ^
Error compiling.

As AVR Wire library header is being included instead of SAM.

@matthijskooijman
Copy link
Collaborator

At first glance, the change looks good to me. I'm not sure if this bug has been around for a long time and just not noticed, or if there used to be some call the onBoardOrPortChange() later in the process that has been refactored away, but this change looks ok to me in any case.

ffissore added a commit that referenced this pull request Sep 8, 2015
Call on onBoardOrPortChange after selectBoard when board argument passed into command line
@ffissore ffissore merged commit f84b58e into arduino:master Sep 8, 2015
@ffissore
Copy link
Contributor

ffissore commented Sep 8, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI The Arduino IDE's command line interface Component: Compilation Related to compilation of Arduino sketches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants