フィルターのクリア

Is it possible to place custom header include statement at the top when using Simulink Coder?

9 ビュー (過去 30 日間)
Yongjun Taylor
Yongjun Taylor 2017 年 3 月 13 日
回答済み: Kushagr Gupta 2017 年 3 月 16 日
Hello!!
I am new to Simulink Coder (SC), and have a problem. I am currently utilizing SC to generate source code only for an embedded system (Not embedded coder). I want to insert a custom header include statement at the top among the include statements that Simulink inserts automatically, which is, for example, mw_cmsis.h (code replacement for STM32F4 Discovery) because the generated include statement (me_cmsis.h) needs the custom header (stm32f4xx_hal.h) to be included first.
To make it short, I want to make my custom include statement precede any include statement. I know there's a 'Configuration Parameters\Code Generation\Custom Code' pane which is related to my concern but it always places my statement at the end of all include statements.
I need your help. Thank you!

回答 (1 件)

Kushagr Gupta
Kushagr Gupta 2017 年 3 月 16 日
One can make use of the Custom Code feature available in Model Configuration Parameters in order to add custom header/ source files.
Go through the "Header file" section at the following link to understand how to do the needful:

Community Treasure Hunt

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

Start Hunting!

Translated by