Generated code for word size 16bit / 32bit

12 ビュー (過去 30 日間)
Lucas NAVET
Lucas NAVET 2020 年 6 月 4 日
コメント済み: Walter Roberson 2020 年 7 月 17 日
Hello,
I use two different target Hardware, with two native word size (16 bits and 32 bits)
Can I use the same generated code (rtwtypes.h) in the two different hardware ? I generate the code with the most restritive size (16 bits).
Thank you for your help,
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 17 日
The same code will not necessarily work. 32 bit devices usually need 32 bit pointers, and do not always have a 16 bit pointer mode. If you have the same settings for both devices, you might be storing pointers into 16 bits, and that might fail.
It is often possible to write C code that can be compiled for 16 or 32 bits, by careful use of data types, and by using a macro or compiler option to indicate which size to compile for the target.

サインインしてコメントする。

採用された回答

Aditya Patil
Aditya Patil 2020 年 7 月 17 日
If both the hardware support the 16 bit setting, then you should have no issues with running the code. If possible, create two different code with the optimal settings for both hardware, so as to make the best use of available features.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by