Embedded Coder: generating void_void function call from empty block and conditional inclusion

4 ビュー (過去 30 日間)
Hi all,
I was wondering if one can easily generate a function call using Embedded Coder just by correctly configuring a Simulink Function call subsystem with no inputs/outputs:
My goal is to generate code like the following:
void Calc(void){
Function();
}
where function is defined in an extern file or in the same main file, but with a preprocessor directive:
#ifndef(INTEGRATE_CODE)
void Function(void){
}
#endif
where INTEGRATE_CODE symbol is only defined once the SW component is integrated.
So, basically, my goal would be to perform a MIL and SIL simulation WITHOUT TESTING THE CALLED FUNCTION. However, once I integrate the component, I substitute the empty call in the callee with something customized, like this:
#define Function()\
do{\
Call_AnotherFunction();\
while(0)
So my questions are: 1) How can I force Embedded Coder to generate a function call if my block has no inputs/outputs? Apparently I can generate a void_void function call only if I have at least one input and at least one output. 2) Is it possible to generate preprocessor conditionals ONLY where the function is defined (not where it's called!)?
Thanks in advance for your help,
Daniele

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by