Configurations

The user can have several configurations of the project in one project file. The configuration system is very simple. Every configuration keeps the enable/disable state of all beans in the project (it does NOT keep bean settings!). If you enable/disable a bean in the project, the bean state is updated in the currently selected configuration. If you create a new configuration the current project state is memorized.

Configurations of the current project are listed in the Project Panel configurations folder. They can be managed using a pop-up menu of the specific configuration or the whole Configurations folder.

Configuration properties and a user comment can be changed in the configuration inspector. See chapter Configuration Inspector for details.

The symbol for conditional compilation is defined if it is supported by selected language/compiler. The symbol PEcfg_[ConfigurationName] is defined in the CPU interface.
The user can switch using this symbol between variants of code according to the active configuration (see example in this chapter).

Configuration also stores which CPU is selected as the target CPU.
If the name of the configuration matches the name of one of the CodeWarrior's targets, this target is automatically selected as an active target when the user runs code generation.

Note: It is possible to have two beans with the same name in Project. Each of the beans could be enabled in different configuration. This way the user can have different setup of a bean (a bean with the same name) in multiple configurations.

Example

Let's have a configuration named 'Testing case'. We would like to use a bean and part of our code using the bean only in the 'Testing case' configuration. We make the Testing case configuration active. After the successful code generation the CPU.H file contains the following definition:

 

/* Active configuration define symbol */
#define PEcfg_Testingcase 1

 

We will surround the part of the code used only in this configuration the following way:

 

...
#ifdef PEcfg_TestingCase
   Bean_MethodCall(...);
#endif
...

 

 

[top of page]