Highlights from
Embedded Coder Support Package for Green Hills MULTI IDE (R2012b)

image thumbnail

Embedded Coder Support Package for Green Hills MULTI IDE (R2012b)

by

 

Embedded Coder integration for creating models that run directly in Green Hills MULTI IDE

getBlockInfo_HwInterrupt_multilink_mpc7400(linkPjtGenInfo, schedPjtGenInfo)
function [linkPjtGenInfo, schedPjtGenInfo] = getBlockInfo_HwInterrupt_multilink_mpc7400(linkPjtGenInfo, schedPjtGenInfo)
%GETBLOCKINFO_HWINTERRUPT_MULTILINK_MPC7400 Get information about a 'Hardware Interrupt' block.

%   $Revision: 1.1.6.1 $ $Date: 2012/04/02 21:40:11 $
%   Copyright 2007-2010 The MathWorks, Inc.

%----------------------------------------------------------
% Look for HW Interrupt blocks in the model
%----------------------------------------------------------
hwInterruptBlocks = linkfoundation.util.FindSystem(linkPjtGenInfo.modelName,'MPC7400 Interrupt Block');

%----------------------------------------------------------
% Check for error conditions
%----------------------------------------------------------
numHwIntBlks = length(hwInterruptBlocks);
if numHwIntBlks==0
    % No HW Interrupt block present in the model
    return;
elseif numHwIntBlks> 1
    % Only 1 HW Interrupt is allowed in the model
    linkPjtGenInfo.error = 1;
    linkPjtGenInfo.errormsg = 'Only one Hardware Interrupt block is allowed in the model';
        return
    end
    
%----------------------------------------------------------
% Update 'schedPjtGenInfo' if a HW Interrupt block is present
%----------------------------------------------------------
% linkPjtGenInfo.numInterrupts  - Number of interrupts in the model
% linkPjtGenInfo.interrupts     - List of interrupt numbers
%----------------------------------------------------------

if ~isempty(hwInterruptBlocks)
    % Get information specified by user
    extintr = get_param (hwInterruptBlocks, 'extintr');
    if (strcmpi(extintr,'on'))
        linkPjtGenInfo.numInterrupts = linkPjtGenInfo.numInterrupts + 1;
        linkPjtGenInfo.interrupts(end+1) = 500;
    end
    mciintr = get_param (hwInterruptBlocks, 'mciintr');
    if (strcmpi(mciintr,'on'))
        linkPjtGenInfo.numInterrupts = linkPjtGenInfo.numInterrupts + 1;
        linkPjtGenInfo.interrupts(end+1) = 200;
    end
    sysrstintr = get_param (hwInterruptBlocks, 'sysrstintr');
    if (strcmpi(sysrstintr,'on'))
        linkPjtGenInfo.numInterrupts = linkPjtGenInfo.numInterrupts + 1;
        linkPjtGenInfo.interrupts(end+1) = 100;
    end
end

%[EOF] getBlockInfo_HwInterrupt_multilink_MPC7400.m

Contact us