亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? linmsg.c

?? BCM 控制demo源代碼
?? C
字號(hào):
#define LINMSG_C
/******************************************************************************
*                                                       
*       Copyright (C) 2005 Freescale Semiconductor, Inc.
*       All Rights Reserved								              
*														                            
* Filename:     linmsg.c                
*														                            
* Revision:      										                    
*														                            
* Functions:    Message processing subsystem 
*												                            
* Description:  
*												                            
* Notes:        
*												                            
******************************************************************************/

#include <linbase.h>

#if !defined(LINAPI_1_0)
#pragma MESSAGE DISABLE C4200 /* WARNING C4200: other segment than in previous declaration */

/****************************************************************************
 * Function prototypes 
 ***************************************************************************/
static void near LinMemCopy( LIN_BYTE * dst, LIN_BYTE * src, LIN_BYTE len);


/****************************************************************************
 * Functions 
 ***************************************************************************/
#pragma CODE_SEG .lintext

 /***************************************************************************
 * Function :   LinMemCopy
 *
 * Description: Copy data from src to dst
 *
 * Returns:     none
 *
 * Notes:       
 *
 **************************************************************************/
void near LinMemCopy( LIN_BYTE * dst, LIN_BYTE * src, LIN_BYTE len)
{
 #if defined(USEXGATE)			/* get semaphore 0*/
    do
        {
        LIN_XGSEM = (LIN_XGSEM_SetSEM0);
        } while (!(LIN_XGSEM & LIN_XGSEM_SEM0));
#endif /* defined(USEXGATE) */

    while( len > 0 )
    {
        len-- ;
        dst[len] = src[len];
    }

#if defined(USEXGATE)
    LIN_XGSEM = (LIN_XGSEM_ClearSEM0);
#endif /* defined(USEXGATE) */			   /* release semaphore 0*/

    return;
}


/***************************************************************************
 * Function :   LIN_GetMsg
 *
 * Description: Find message and copy the message data to the buffer
 *
 * Returns:
 *  LIN_NO_ID       - msg is not configured for this node
 *  LIN_INVALID_ID  - msg is received by this node (but data is copied)
 *  LIN_MSG_NODATA  - msg data has not been received so far
 *  LIN_OK          - msg data is copied to the buffer
 *
 * Notes:       Freescale API function, OPTIM
 *
 **************************************************************************/
LINStatusType near LIN_GetMsg( LINMsgIdType msgId, LINMsgRefType msgData )
{
    LIN_BYTE    idx;
    LIN_BYTE    intMask;
    LIN_BYTE    retStatus;

    /* check requested Id */
    if ( msgId > (LIN_BYTE) LIN_FRAME_MAX_ID )
    {
        /* Id is not valid */
        return LIN_NO_ID;
    }

    /* Search message */
    idx = LinLookupTable[msgId];

    if ( (idx & LIN_MSG_NOT_IGNORED) == 0 )
    {
        /* message is ignored by this node */
        return LIN_NO_ID;
    }

    LIN_DBG_SET_PORT_7;
    intMask = LIN_DisableInt();         /* disable interrupts */

    /* If we transmit this message return error */
    if ( idx & LIN_MSG_SEND ) 
    {
        /* we send this message, but copy anyway */
        /* NB: not initialized data can be copied ! */

#if defined(MASTER)
        LinMemCopy( msgData, LinMsgBuf[idx & LIN_MSG_INDEX_MASK], LinLengthTable[msgId]);
#endif /* defined(MASTER) */

#if defined(SLAVE)
        /* Message's index is least 6 bits. */
        idx &= LIN_MSG_INDEX_MASK;

        LinMemCopy( msgData, LinMsgBuf[idx], LinMsgLen[idx]);
#endif /* defined(SLAVE) */


        /* don't change msg status */

        retStatus = LIN_INVALID_ID;
    }
    else
    {
        /* we receive this message */

        /* Message's index is least 6 bits. */
        idx &= LIN_MSG_INDEX_MASK;

                                 /* LinMsgStatus can be change from interrupt only to LIN_MSG_OK or */
                                 /* LIN_MSG_OVERRUN so we didn`t need close interrupt early  */
                                 /* ??? paranoia: LinMsgStatus can be changed to LIN_MSG_NODATA only from */ 
                                 /* LIN_Init if call it from interrupt */

        /* Check if there is data */
        if (( LinMsgStatus[idx] & LIN_MSG_NODATA ) != 0 )
        {
            /* no data -> don't copy */
            retStatus = LIN_MSG_NODATA;
        }
        else
        {    
            /* If message was found copy the data */


#if defined(MASTER)
            LinMemCopy( msgData, LinMsgBuf[idx], LinLengthTable[msgId]);
#endif /* defined(MASTER) */

#if defined(SLAVE)
            LinMemCopy( msgData, LinMsgBuf[idx], LinMsgLen[idx]);
#endif /* defined(SLAVE) */

            /* change message status */
            LinMsgStatus[idx] = LIN_MSG_NOCHANGE;

            retStatus   = LIN_OK;
        }    
    }
    
    LIN_EnableInt(intMask);             /* enable interrupts */
    LIN_DBG_CLR_PORT_7;

    return retStatus;
}

/***************************************************************************
 * Function :   LIN_PutMsg
 *
 * Description: find and write message 
 *
 * Returns:
 *  LIN_NO_ID       - msg is not configured for this node
 *  LIN_INVALID_ID  - msg is transmitted by this node
 *  LIN_OK          - data is copied to the msg buffer
 *
 * Notes:        Freescale API function, OPTIM
 *
 **************************************************************************/
LINStatusType near LIN_PutMsg( LINMsgIdType msgId, LINMsgRefType msgData )
{
    LIN_BYTE    idx;
    LIN_BYTE    intMask;
    
    /* check requested Id */
    if ( msgId > (LIN_BYTE) LIN_FRAME_MAX_ID )
    {
        /* Id is not valid */
        return LIN_NO_ID;
    }

    /* Search message */
    idx = LinLookupTable[msgId];

    if ( (idx & LIN_MSG_NOT_IGNORED) == 0 )
    {
        /* message is ignored by this node */
        return LIN_NO_ID;
    }

    /* If we receive this message return error */
    if ( ( idx & LIN_MSG_SEND ) == 0 )
    {
        return LIN_INVALID_ID;
    }

    /* Node process this message. Message's index is least 6 bits. */
    idx &= LIN_MSG_INDEX_MASK;

    LIN_DBG_SET_PORT_7;
    intMask = LIN_DisableInt();     /* disable interrupts */

    /* If message was found then copy the data */

#if defined(MASTER)
    LinMemCopy( LinMsgBuf[idx], msgData, LinLengthTable[msgId]);
#endif /* defined(MASTER) */

#if defined(SLAVE)
    LinMemCopy( LinMsgBuf[idx], msgData, LinMsgLen[idx]);
#endif /* defined(SLAVE) */

    /* change the status */
    LinMsgStatus[idx] = LIN_MSG_NOCHANGE | LIN_MSG_UPDATED;
    
    LIN_EnableInt(intMask);         /* enable interrupts */
    LIN_DBG_CLR_PORT_7;

    return LIN_OK;
}

/***************************************************************************
 * Function :   LIN_MsgStatus
 *
 * Description: Return current message status 
 *
 * Returns:    
 * When message is specified as received:
 *  LIN_NO_ID           - msg is not configured for this node
 *  LIN_OK              - msg data changed since last LIN_GetMsg call;
 *  LIN_MSG_NOCHANGE    - msg data not received since last LIN_GetMsg call;
 *  LIN_MSG_NODATA      - msg data not received since driver initialization;
 *  LIN_MSG_OVERRUN     - msg data was overwritten by driver before read.
 *
 * When message is specified as transmitted:
 *  LIN_NO_ID           - msg is not configured for this node
 *  LIN_OK              - msg data transmitted since last LIN_PutMsg call;
 *  LIN_MSG_NOCHANGE    - msg data not transmitted since last LIN_PutMsg call;
 *  LIN_MSG_NODATA      - msg data not updated since driver initialization.
 * 
 * Notes:               Freescale API function, OPTIM
 *
 **************************************************************************/
LINStatusType near LIN_MsgStatus( LINMsgIdType msgId )
{
    LIN_BYTE    idx;

    /* check requested Id */
    if ( msgId > (LIN_BYTE) LIN_FRAME_MAX_ID )
    {
        /* Id is not valid */
        return LIN_NO_ID;
    }

    /* Search message */
    idx = LinLookupTable[msgId];

    if ( (idx & LIN_MSG_NOT_IGNORED) == 0 )
    {
        /* message is ignored by this node */
        return LIN_NO_ID;
    }

    /* Node process this message. Message's index is least 6 bits. */
    return ( LinMsgStatus[idx & LIN_MSG_INDEX_MASK] & LIN_MSG_STATUS_MASK );
}

#endif /* !defined(LINAPI_1_0) */
#pragma CODE_SEG DEFAUL

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久婷婷国产综合精品青草| 成年人网站91| 欧美日韩国产另类不卡| 中文字幕二三区不卡| 日韩欧美一区二区视频| 中文字幕不卡一区| 美国三级日本三级久久99| 91精品1区2区| 成人免费在线视频| 国产jizzjizz一区二区| 日韩视频在线一区二区| 亚洲图片有声小说| 91国产丝袜在线播放| 欧美丝袜第三区| 欧美日韩亚洲综合在线| 国产精品女主播在线观看| 激情av综合网| 久久亚洲精精品中文字幕早川悠里| 亚洲国产精品天堂| 精品视频在线免费| 亚洲电影在线播放| 欧美影院午夜播放| 亚洲va在线va天堂| 欧美精品久久天天躁| 视频一区国产视频| 91精品国产色综合久久久蜜香臀| 亚洲午夜激情网站| 欧美日韩精品欧美日韩精品一| 一区二区三区在线视频免费| 色菇凉天天综合网| 亚洲一区二区三区四区不卡| 91国产丝袜在线播放| 午夜精品123| 亚洲精品一区二区三区蜜桃下载| 国产精品123区| 亚洲精品亚洲人成人网| 欧美精品精品一区| 狠狠色丁香久久婷婷综| 国产精品国产成人国产三级| 一本久久精品一区二区| 秋霞影院一区二区| 国产精品三级av在线播放| 欧美亚洲免费在线一区| 欧美aⅴ一区二区三区视频| 国产成人99久久亚洲综合精品| 欧美成人vps| 色综合久久久久网| 麻豆国产欧美一区二区三区| 久久精品免视看| 一本到一区二区三区| 天天影视网天天综合色在线播放| 国产成人av福利| 午夜欧美2019年伦理| 国产精品欧美经典| 日韩欧美一卡二卡| 色综合天天视频在线观看| 捆绑调教美女网站视频一区| 中文字幕五月欧美| 精品精品国产高清一毛片一天堂| 99re这里都是精品| 国产专区欧美精品| 蜜芽一区二区三区| 亚洲国产成人精品视频| 自拍偷拍亚洲欧美日韩| 国产午夜精品久久久久久久| 欧美一二三区在线观看| 欧美久久久久久久久中文字幕| 波多野结衣精品在线| 欧美性欧美巨大黑白大战| 国产一区二区三区免费| 五月天久久比比资源色| 亚洲国产精品一区二区www| 欧美日韩卡一卡二| 日本黄色一区二区| 91麻豆精品在线观看| 成人avav在线| 日韩精品亚洲一区二区三区免费| 中文字幕日韩一区二区| 日韩一区中文字幕| 中文字幕在线不卡国产视频| 最新欧美精品一区二区三区| 国产精品国产三级国产aⅴ无密码| 亚洲国产精品激情在线观看| 国产毛片精品国产一区二区三区| 国产精品丝袜一区| 国产色产综合产在线视频| 久久免费看少妇高潮| 久久蜜桃一区二区| 91精品啪在线观看国产60岁| 日韩欧美高清dvd碟片| 久久久亚洲国产美女国产盗摄| 国产精品网站在线播放| 国产精品欧美极品| 亚洲精品高清在线| 男男gaygay亚洲| 北岛玲一区二区三区四区| 91美女在线视频| 91精品国产综合久久精品app| 精品嫩草影院久久| 亚洲乱码国产乱码精品精小说| 亚洲乱码精品一二三四区日韩在线| 亚洲黄网站在线观看| 日本aⅴ亚洲精品中文乱码| 国内精品久久久久影院薰衣草| 成人v精品蜜桃久久一区| 欧美影院午夜播放| 久久婷婷成人综合色| 亚洲国产精品一区二区久久| 日本美女一区二区三区视频| 黄色精品一二区| 精品亚洲成av人在线观看| 国产精品1区2区| 欧洲国产伦久久久久久久| 日韩一区二区在线观看视频 | 亚洲国产精品欧美一二99| 日韩电影在线免费| 成人毛片在线观看| 色噜噜狠狠一区二区三区果冻| 91精品国产综合久久精品麻豆| 日韩三级伦理片妻子的秘密按摩| 精品粉嫩aⅴ一区二区三区四区| 国产日产欧美精品一区二区三区| 亚洲国产精品嫩草影院| 99久久伊人精品| 中文字幕国产精品一区二区| 麻豆精品视频在线观看免费| 欧美日韩aaaaa| 亚洲韩国精品一区| 在线免费亚洲电影| 亚洲嫩草精品久久| 99麻豆久久久国产精品免费优播| 久久精品人人做| 大白屁股一区二区视频| 国产福利电影一区二区三区| 精品久久久久久久一区二区蜜臀| 日精品一区二区| 91麻豆精品国产91久久久资源速度| 一区二区三区在线观看国产| 91免费看片在线观看| 一区二区三区在线视频免费| 99久久精品一区| 亚洲午夜影视影院在线观看| 欧美日韩黄视频| 日本不卡在线视频| 欧美va亚洲va香蕉在线| 国产一区二三区| 中文字幕一区二区5566日韩| 91在线视频播放地址| 亚洲综合一区二区精品导航| 欧美午夜精品久久久久久超碰| 最新日韩av在线| 这里只有精品免费| 国产最新精品免费| 国产精品国产三级国产普通话蜜臀| 91在线观看视频| 日韩精品午夜视频| 日韩欧美电影一二三| 国产成人在线免费观看| 亚洲精品大片www| 久久尤物电影视频在线观看| av一区二区三区黑人| 美腿丝袜亚洲三区| 综合久久给合久久狠狠狠97色| 欧美裸体一区二区三区| 国产色产综合色产在线视频 | 日韩三区在线观看| 国产综合成人久久大片91| 国产精品午夜免费| 在线看日本不卡| 中文字幕亚洲一区二区av在线| 从欧美一区二区三区| 26uuu亚洲综合色欧美 | 一本大道久久a久久精二百| 一区二区三区四区五区视频在线观看| 色综合久久久久综合| 奇米精品一区二区三区在线观看 | 亚洲国产综合在线| 在线视频国内自拍亚洲视频| 国产精品一区三区| 亚洲精品久久久蜜桃| 欧美疯狂做受xxxx富婆| 懂色中文一区二区在线播放| 亚洲乱码一区二区三区在线观看| 欧美欧美午夜aⅴ在线观看| 国内精品久久久久影院一蜜桃| 欧美午夜在线一二页| 久久国产精品99久久人人澡| 亚洲特黄一级片| 欧美一区二区三区爱爱| 91片黄在线观看| 91亚洲精品乱码久久久久久蜜桃| 日韩极品在线观看| 国产精品嫩草久久久久| 欧美天天综合网| 国产乱理伦片在线观看夜一区| 日本特黄久久久高潮| 亚洲区小说区图片区qvod| 久久亚区不卡日本| 欧美亚洲动漫制服丝袜| 欧美日本乱大交xxxxx|