Author Topic: Processor Macro For Embedded Development Tools  (Read 11181 times)

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Processor Macro For Embedded Development Tools
« on: August 08, 2010, 02:51:52 pm »

Hi,
First of all I want to thank all of u for that very nice IDE called Code::Blocks! ;) My experience is in the embedded field mostly with a couple of MCUs so I'm very inexperienced on the PC side. At the moment I am mainly concerned with AVR wizard discussed here:

http://forums.codeblocks.org/index.php?topic=6962.0;prev_next=prev

The wizard passes the Processor information to the linker with a "Processor" variable to adjust the linker. Is there a way to assign this variable to a macro like "${PROCESSOR}" to be used elsewhere i.e. script programming the target AVR type or adjusting debug target type automatically? If something like this could be implemented it would be useful in every embedded target like 'ARM, MSP430 etc...'. Need help with this, thnx...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Processor Macro For Embedded Development Tools
« Reply #1 on: August 08, 2010, 08:40:07 pm »
Please look at Custom variables; they might do what you want.

Under "Project" -> "Build Options" Tab "Custom variables"

http://wiki.codeblocks.org/index.php?title=Variable_expansion

Tim S.
« Last Edit: August 08, 2010, 08:42:35 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Processor Macro For Embedded Development Tools
« Reply #2 on: August 08, 2010, 09:54:53 pm »

I found a way to do it. When I add the line:

Code
project.SetVar(_T("MCU"), Processor, false);

to the avr wizard script, I see the "MCU" variable paired with the avr type (processor var in the script) on the "Custom Variables" tab. Is there a more convenient way to do this or shall I deal with this no longer? And is there also a compiler specific menu? Like when the AVR compiler is chosen a user tools menu including only the tools chosen about AVR.

Regards...