Code covered by the BSD License  

Highlights from
Real-Time Workshop Embedded Coder Custom Code Tips and Scripts

image thumbnail

Real-Time Workshop Embedded Coder Custom Code Tips and Scripts

by

 

11 Sep 2003 (Updated )

Has new software and examples to customize generated code files

ert_rtw_info_hook(varargin)
function varargout = ert_rtw_info_hook(varargin)
% ERT_RTW_INFO_HOOK - ERT target hook file to provide Real-Time Workshop
% the necessary target specific information.
%
%   *** Modify and save this file on the MATLAB path or working directory.
%   ***
%   *** Information for the most popular targets is listed below.  If your
%   *** target is not listed, type 'help example_rtw_info_hook' in MATLAB
%   *** to determine the necessary information.
%   ***
%   *** Most of these settings are compiler specific so you should
%   *** confirm the selected values with your compiler vendor.

% Copyright 1994-2003 The MathWorks, Inc.
% $Revision: 1.1 $ $Date: 2003/04/23 20:32:31 $

Action    = varargin{1};
modelName = varargin{2};

switch Action
 case 'wordlengths'

  % Target word lengths
  %
  % .---------------------------------------------.----.-----.-----.----.
  % | Microprocessor                              |char|short| int |long|
  % |---------------------------------------------|----'-----'-----'----|
  % | 32-bit floating-point: Motorola PPC, 683XX, | 8  | 16  | 32  | 32 |
  % | Renesas (Hitachi) SH-2/SH-3,                |    |     |     |    |
  % | Renesas (Mitsub) M32R, Intel x86            |    |     |     |    |
  % |---------------------------------------------|----|-----|-----|----|
  % | 32-bit fixed-point: TI C28xx, Infineon      | 8  | 16  | 32  | 32 |
  % | Tricore, ARM7                               |    |     |     |    |
  % |---------------------------------------------|----|-----|-----|----|
  % | 16-bit fixed-point: Motorola HC12, Infineon |    |     |     |    |
  % | C166, TIC24xx, Renesas (Hitachi) H8S        | 8  | 16  | 16  | 32 |
  % |---------------------------------------------|----|-----|-----|----|
  % | 8-bit fixed-point: Motorola HC08            | 8  | 16  | 16  | 32 |
  % `---------------------------------------------'----'-----'-----'----'
  
  value.CharNumBits  = 8;
  value.ShortNumBits = 16;
  value.IntNumBits   = 32;
  value.LongNumBits  = 32;
  varargout{1} = value;
  
  % Or, simply uncomment the line below if you are self-targeting the
  % host computer (i.e., the same platform where you generate the code).
  %varargout{1} = rtwhostwordlengths(modelName);
  
 case 'cImplementation'
  
  % C-language behavior
  %
  % Set ShiftRightIntArith true if shift right on a signed integer is
  % implemented as arithmetic shift, and false otherwise.  Virtually all
  % environments implement arithmetic shift right, including all those
  % listed in the table above.  Therefore, you should not need to modify
  % the default setting.
  
  value.ShiftRightIntArith = true;
  varargout{1} = value;

 otherwise
  
  % Gracefully accommodate future releases of Real-Time Workshop
  
  varargout{1} = [];
  
end


Contact us