Q on altering boards.txt

Status
Not open for further replies.

stevech

Well-known member
Is it OK to add this to my boards.txt file?
teensy31.build.option5=-DF_CPU=96000000;USB_SERIAL;LAYOUT_US_ENGLISH

The stock file has teensy31.build.option4 as the last.

I did the above, then restarted my IDE (VisualMicro/Studio6) and it read in boards.txt. Then I removed the IDE project properties definition with the same info. Now compiled OK.
I believe this eliminates me having to put -DF_CPU in each project's properties. This is a PITA with source code I have that often targets Teensy2/AVR and Teensy 3 by just changing the target MCU in the IDE and recompiling.

I ask, because I don't know how boards.txt is parsed and if teensy31.build.option5= would be unexpected by the IDE.

I'd also add, for Teensy 3.0
teensy3.build.option5=-DF_CPU=96000000;USB_SERIAL;LAYOUT_US_ENGLISH
 
Last edited:
Do you know if I can use this syntax?
teensy31.build.option5=-DF_CPU=96000000;USB_SERIAL;LAYOUT_US_ENGLISH

I need to find a document on how boards.txt is structured and use by the IDE in creating compiler command lines. I.e., does the IDE take any teensy31.build.option* ?

Thanks
 
I don't knowif this works, but why don't you try it out ?

If it does not work, something like

teensy31.build.option5=-DF_CPU=96000000
teensy31.build.option6=-DUSB_SERIAL
teensy31.build.option7=-DLAYOUT_US_ENGLISH

should work (i did not test this)

Good Luck !
 
Success! Seems that adding *.build.optionxx where xx is a successive number works. The new params are passed to the build process.

When I added the below to (Windows) C:\Arduino\hardware\teensy\boards.txt, whoopie, the IDE I'm using (VisualMicro/VS) no longer needs a special project setting. Just pick a Teensy board. Saves a PITA resetting more than just the board type in that IDE. Now, it's quick.

teensy31.build.option5=-DF_CPU=96000000
teensy31.build.option6=-DUSB_SERIAL
teensy31.build.option7=-DLAYOUT_US_ENGLISH

(same as above for teensy 3 entries)
 
Status
Not open for further replies.
Back
Top