Can compiler options (in Arduino build) be set in the source code somehow?

blahfoo

Well-known member
Hi, I'd like to be able to switch between building a Teensy 3.2 project and a T4.1 project without manually changing the board type, speed, optimization, and USB type under the Tools menu. Perhaps somehow in command line parameters driven by a shortcut?

One can select the source folder in a windows shortcut (or batch file), but that's all that is obvious to me.

And how many of you use a makefile or other build process rather than punching the buttons on the Arduino GUI? Specifying the include files when needing to switch between older and newer versions of the same library filename is an issue also.

How do you deal with it?
 
I should probably qualify that I use an external editor for code and not the Arduino editor, so perhaps I'm outside of their "Sketches" plan.
 
Is this the same sketch on both - or a unique sketch?

One way is install IDE 1 and IDE 2 and build the unique Teensy in each.


7 years ago this https://github.com/Defragster/Tset was a good way to use an external editor that could execute batch files ( SubLimeText or NotePad++, other?? ) - hasn't been updated in 4 years when it was working with T_4.x - stopped using it after building this new machine 2 years back when two IDE solution was good enough when needed.

TSET has a ReadMe - but generally::
>one batch file prompted for MCU and build settings, and created a batch file running the IDE 1 CMDLINE build
>Request in the 'editor of choice' to build ran that batch file in the sketch folder
>used CmdLine interface to TyCommander for upload and SerMon debugging
 
I use visual studio code (VSCode) with task extension, where I can switch between different configurations of VSCode and associated Makefile settings.

key files are (in addition to Makefile)
  • tasks.json
  • c_cpp_properties.json
 
Last edited:
Back
Top