692 views
in System Integration by
In some case it is necessary to get information, defined in Embedded Wizard macros, in the C-code of an application. How to realize this?

1 Answer

0 votes
by

In a profile you can define a macro, but macros are not automatically exported as defines in the generated C-code. To get a #define in the generated C-code we recommend the following way:

  1. Create a macro in the profile where you want to get a #define in the generated code. For example, create the macro "NTSC" and set its content to "true" or "false" and another macro “MaxNoOfChannels” with the content 3000.
  2. Create a new unit e.g. “Configuration“ and get an "Inline Code"-brick from the Gallery into this unit.
  3. The inline code can be edited in the editor window. There you can implement your #defines dependent on the EmWi macro contents e.g.:
$if $NTSC
   #define CONFIGURATION_NTSC_ENABLED 1 
$else 
  #define CONFIGURATION_NTSC_ENABLED 0 
$endif

#define CONFIGURATION_MAX_NO_OF_CHANNELS $MaxNoOfChannels

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...