It's necessary to say at the beginning of the chapter, that
modification of the generated code may be done only at user's own risk.
Generated code was thoroughly tested by the skilled developers and the
functionality of the modified code cannot be guaranteed. We strongly don't
recommend modification of the generated code to the beginners. See more
information for generated modules in chapter Code
Generation. To support user changes in the bean modules, Processor Expert supports
the following features: Processor Expert automatically produce list of manifest constants for
all beans, which encapsulate any CPU peripheral and modifies any of the
CPU control registers. The name of each manifest constant is in the
following format: C_[bean+method]_reg_[register name][additional-info] where
These constants may be used to write user code, which reflects the bean
settings. Once the constant is generated into the CH file, it is preserved
there even it is already not used in the bean module. The most important
advantage of these constants is, that small changes in the bean settings (for
example timing) does not cause change of the bean module, but the only CH
file is changed. The name of the CH file is derived from the CPU bean name ([CPUbean].CH).
To generate CH file it is necessary to set the following option: Project
Options | Generate manifest constants. CH file is generated
also while smart generation of bean modules code, see paragraph 3 for
details. CH file is always overwritten during the code generation. It's possible to select mode of the code generation for each bean, the
following options can be found in the bean's
pop-up menu in the project panel: Code Generation
The mode of code generation is indicated as a bean's status in the
project panel. This mode influences only the generation of bean modules (bean.c,
bean.h). Processor Expert also allows to enable/disable generation of the
modules that not related to a specific bean or that are common for several
beans. This option can be configured in the pop-up
menu of the module in the Project Panel. Current enable/disable state
of this option is signalled by the icon near the bean module name in the
Project Panel ( Notice: Smart user changes preservation is available only in the
56F800/E version. To enable smart generation of the bean modules, it's necessary to set
the project option Project
Options | Preserve user changes. (option Project
Options | Generate manifest constants is turned on
automatically). After setting this option it's necessary to generate the
code and after that Processor Expert can detect and preserve changes in
the generated code of bean modules. In this mode it is still possible to
select for each bean, if the code will be overwritten, not written or if
the user changes will be preserved (see paragraph 2). In case of first use
of the bean, the generated code will be always overwritten. The generated code of the bean module may be changed from several
reasons:
The following changes in the generated code may be updated
automatically into the bean's module:
In all other cases the user must select how to handle the changed code
(see the following picture):
The user changes done in a bean module or bean header module can be
viewed using a bean pop-up menu commands Compare
With Previously Generated Module and Compare
With Previously Generated Header Module. See chapter Beans
Pop-up Menus for details. The user can also enable reviewing all
changes done into the generated code after each code generation. See
chapter Tracking Changes in Generated Code
for details.
|