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

2 visualizzazioni (ultimi 30 giorni)
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,

Risposte (0)

Categorie

Scopri di più su Complex Logic in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by