Skip to content

Export selected board port to arduino-builder as -prefs=~something.port=<selected_port> #1010

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

Open
garnould opened this issue Nov 9, 2018 · 3 comments
Labels
type: enhancement Proposed improvement

Comments

@garnould
Copy link

garnould commented Nov 9, 2018

I am working on a sketch that as to be reconfigured manually when uploaded to one board (acting a a server) or another one (acting as a client).

I'd love to use preprocessor directives (#if) so that the sketch is automatically setup for the target, depending on the selected (board) port.

It looks that the would be straight forward to define the port in platform.txt (-D TARGET_PORT={~something.port}) if that information was made available.

Could IDE append this selected port info as a -prefs on cmdline while running arduino-builder ?

@matthijskooijman
Copy link
Collaborator

A complication of doing this is that when changing the port, all code must be recompiled (since it can potentially change), which I think we normally want. I cannot see an obvious way to make this work for your sketch, without affecting the compilation performance of other sketches...

@garnould
Copy link
Author

You're right Matthijs, disabling compilation cache (when needed) affect compilation performance.

Let's say this feature would be for advanced users/dev (eg. working on modifying packages, my case) : this feature request would be totally transparent (as it only declares a new prefs that is used or not by developers) and permit to people like me to gain a lot of time when recompiling/uploading firmware to several different devices "at once".

@per1234 per1234 transferred this issue from arduino/Arduino Oct 5, 2020
@per1234
Copy link
Contributor

per1234 commented Oct 5, 2020

We have a dedicated feature request for allowing the build cache to be cleaned: #969

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants