How can I define my "asm" variable in my model Simulation Target using StateFlow?

3 次查看(过去 30 天)
Hello,
I am trying to Integrate my Custom C Code in Stateflow based on this example of the documentation.
I have added certain directories containing my hedaers/implementation files in Simulation Target >> Include Directories that I will make use.
When running the model, which is nothing more that the default example with my directories, I am running into an issue where Matlab cannot find __asm__ as stated
Error c:\\j\\documents\\matlab\\acquisition.c: c:\\localdata\\projects\\firmwareprojects\\fw\\support\\my_math.h: 97 undeclared identifier '__asm__'
Error c:\\j\\documents\\matlab\\acquisition.c: c:\\localdata\\projects\\firmwareprojects\\fw\\support\\my_math.h: 97 Syntax error; missing semicolon before `volatile'
Looking the file my_math.h at line 97 I have the following function
static inline unsigned __abs(int value)
{
unsigned result; // ABS inputval, outputval
__asm__ volatile("ABS %1, %0" : "=r" (result) : "r" (value));//line 97
return result;
}
How can I define the variable asm so that I can compile the model?
I have tried to define the variable under the Defines option as shown below but not luck.
THanks in advance,

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Complex Logic 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by