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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by