Can I use typedef in a C-file S-function?
2 次查看(过去 30 天)
显示 更早的评论
I'm simulating some C code from an STM32 MCU in a Matlab Simulink model using a C-file S-Function. In my MCU code I use a typedef as follows:
typedef enum
{
DECEL = 0, //
ACCEL = 1, //
COAST = 2 //
} PFD_State_t;
I'd like to use this typedef in my S-Function mdlUpdate function to compute my algorithm using a case statement based on the enum. How do I do this? Can I include my own custom *.h file when compiling the S-Function?
Thanks,
Brianinclde
2 个评论
James Tursa
2021-10-20
编辑:James Tursa
2021-10-20
You should be able to use any valid C/C++ code in an S-Function, including using header h files. Have you tried something that didn't work? Can you post it?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block and Blockset Authoring 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!