How to remove 'sl_padding' fields in the generated code using Simulink Coder in MATLAB R2022b?
显示 更早的评论
I am generating code for a top model using Simulink Coder in MATLAB R2022b. When using "rtwsfcn.tlc," I noticed extra "sl_padding" fields in the generated code, specifically in the *_types.h file. Please refer to the following code snippets for more details:
Using rtwsfcn.tlc:
typedef struct {
boolean_T EN[2];
uint8_T sl_padding0[2]; -> padding here
real32_T Value[2];
int32_T Time[2];
uint8_T sl_padding1[4]; -> padding here
} EN_Value_Time2;
Using a custom TLC:
typedef struct {
boolean_T EN[2];
real32_T Value[2];
int32_T Time[2];
} EN_Value_Time2;
How to avoid having "sl_padding" in the generated code using "rtwsfcn.tlc" target?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!