You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
The text was updated successfully, but these errors were encountered:
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...
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".
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 ?
The text was updated successfully, but these errors were encountered: