How to configure embeded coder, so that global parameters will not be initialized where they are defined but in the init function?

1 次查看(过去 30 天)
Hallo,
when I generate code and I have e.g. a parameter defined in the data dictionary with storage class = "Auto", the code generator will generate something like this:
/* Model block global parameters (auto storage) */
UInt16 rtP_myParameter123_u16 = 1U; /* Variable: myParameter123_u16
But in our project it's not allowed to init variables here but only in the init function (due to Soft-Reset functionality) Therefore I need the code like:
/* Model block global parameters (auto storage) */
UInt16 rtP_myParameter123_u16; /* Variable: myParameter123_u16
And in the init function:
/* Model initialize function */
void myModel_initialize(void)
{
rtP_myParameter123_u16 = 1U;
...
I also need this behaviour not only for parameters but in general for all inits.
Thank you

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by