⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mc9s12_rtw_info_hook.m

📁 simulink real-time workshop for dragon12 development board from
💻 M
字号:
function varargout = example_rtw_info_hook(varargin)
% mc9S12_RTW_INFO_HOOK - hook file for providing Real-Time Workshop
% with the necessary target specific information regarding the target hardware.
%
%
% Word lengths (case 'wordlengths'):
%
% CharNumBits  : Number of bits for C 'char'  type
% ShortNumBits : Number of bits for C 'short' type
% IntNumBits   : Number of bits for C 'int'   type
% LongNumBits  : Number of bits for C 'long'  type
%
% Implementation specific properties (case 'cImplementation'):
%
% ShiftRightIntArith   : Set true if shift right on a signed integer
%                        is implemented as arithmetic shift, and false
%                        otherwise.  For example,
%
%                        int a = -8;
%                        int b;
%                        b = a >> 1;
%
%                        In the ANSI-C standard states the above example
%                        has undefined behavior.  If the result of 'b' is
%                        -4 it is safe to assume that shift right on signed
%                        integers is implemented as arithmetic shift right,
%                        and you should set the option true.
%
% Float2IntSaturates   : Conversion from float to integer automatically
%                        saturates, therefore do not generate software
%                        saturation code.
%
% IntPlusIntSaturates  : Integer addition automatically saturates,
%                        therefore do not generate software
%                        saturation code.
%
% IntTimesIntSaturates : Integer multiplication automatically saturates,
%                        therefore do not generate software
%                        saturation code.
%
% If you are not certain about the proper settings for your target,
% type 'rtwtargetsettings' in MATLAB for more details.

% Copyright 1994-2002 The MathWorks, Inc.
% $Revision: 1.1 $ $Date: 2002/03/29 19:45:58 $

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

switch Action
 case 'wordlengths'

  % specify the target word lengths
  
  value.CharNumBits  = 8;
  value.ShortNumBits = 16;
  value.IntNumBits   = 16;      % fw-02-05
%  value.IntNumBits   = 32;		% modified to 32 bit, FW-12-03
  value.LongNumBits  = 32;
  varargout{1} = value;
  
 case 'cImplementation'
  
  % specify various C-language information
  
  value.ShiftRightIntArith   = true;
  value.Float2IntSaturates   = false;
  value.IntPlusIntSaturates  = false;
  value.IntTimesIntSaturates = false;
  varargout{1} = value;
  
 otherwise
  
  % Properly accommodate future releases of Real-Time Workshop
  
  varargout = [];
  
end


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -