How do I add a preprocessor-command and avoid double-types when using simulink-coder

3 views (last 30 days)
I've started working with simulink-coder (for creating c-code) and an existing project and I need some tips/ideas about the following problems:
  • I've a bus defined in simulink, which gets translated in a struct in the c-code. I need a preprocessor command (#pragma pack(push, 1)) added to the definition of the struct automatically during translation.
  • I'm using a 32bit processor, so I don't want to evaluate any double-calculations. What's the easiest way to avoid them? At first I thought I "just" change the "Hardware Implementation"-entries, but than I still can find a double-datatype in "rtwtypes.h".
  • I want the coder to use sinf() instead of sin() for the same reasons.
Can you give me some hints about solving this problems?
Stephan Lanser
  1 Comment
Gianmarco Odorizzi
Gianmarco Odorizzi on 20 Nov 2020
I am also facing the same issue, did you manage to insert #pragma directives before and after the declaration of a struct in the header file?

Sign in to comment.

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!