Disable generation of header files for Function Caller

2 views (last 30 days)
Hi,
How can I disable generation of multiple header files for each Function Caller I add when using the simulink embedded coder?
I essentially would like the extern function definition to be within SwcApplMaster.c itself to keep the code footprint small.
I am using a dsPIC33 as the target. Thanks.

Accepted Answer

Pratyush Swain
Pratyush Swain on 18 Mar 2025
Hi Shamoil,
If the Simulink function corresponding to the function caller block is in the same model, the header file name can be configured through defining a function customization template for the Simulink function and setting header and source file names (However this is available only since R2023b).
To create a function customization template, follow these steps:
  1. In the model, set model configuration parameter System target file to ert.tlc. To use a function customization template, you must use an ERT-based system target file.
  2. In the Simulink Editor, open the Embedded Coder app and open the Embedded Coder Dictionary.
  3. In the Embedded Coder Dictionary, on the Function Customization Template tab, click Create.
  4. For the new function template, set these properties: Name, Header File, Definition File
This way, the function caller block in the model will use the same header file name as the Simulink function.
  1 Comment
Shamoil
Shamoil on 20 Mar 2025
Thanks Pratyush, we need to continue using r2022b for our toolchain, so I will have to workaround this solution somehow. Thanks for your answer.

Sign in to comment.

More Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!