401 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...