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 CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by