Hi daniel,
My destination is initialize the resolver of AD2S1205,the right of the below picture is the program of initialization.And the left of picture is the simulink model equal to the right.
but,the result of the Code generation is below
and the result is right ,but that is tedious,is not advantageous to optimize program,can you give me some advise?
the attachement is the model.
Original Attachment has been moved to: Reslover.zip
Hi Eden Li,
There are a few easy things to modify the code generation in order to be more easy to read and a bit faster:
#1: use boolean constants instead of performing necessary conversions
This will remove extra RAM for holding data type conversion and an additional assignment instruction
#2: remove the S-function input arguments
This will remove extra RAM by avoiding loading unnecessary structures;
#3: even this is not absolutely needed - i prefer to use atomic system for each of the steps needed for resolver initialization
#4: use priorities (see https://community.nxp.com/thread/449904#comment-899761 ) to ensure the proper calling sequence of each step
The final model should look like this (this is a personal preference)
For more complex model you can also deploy Code Generation Objectives to get better performance/code size/debuggin.
Hope this helps!
Best regards,
Daniel
PS: Attached is a modified version i used to capture the screenshots
Hi Eden Li,
I branched your reply in a separate topic not to mixed up the things. I'll have a look and try to suggest some potential approaches. Stay tuned.
Best regards,
Daniel