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

📄 linerr.c

📁 BCM 控制demo源代码
💻 C
字号:
#define LINERR_C
/******************************************************************************
*                                                       
*       Copyright (C) 2005 Freescale Semiconductor, Inc.
*       All Rights Reserved								              
*														                            
* Filename:     linerr.c                
*														                            
* Revision:      										                    
*														                            
* Functions:    LIN Error management module
*												                            
* Description:  
*												                            
* Notes:        
*												                            
******************************************************************************/

#include <linbase.h>

#pragma MESSAGE DISABLE C4200 /* WARNING C4200: other segment than in previous declaration */

/****************************************************************************
 * All common-purpose RAM variables shall be declared here.
 * Some of the variables (more often used) can be located in the DIRECT page
 ***************************************************************************/
#if defined(USEZEROPAGE)
#pragma DATA_SEG __SHORT_SEG ZeroSeg
#endif /* defined(USEZEROPAGE) */

LIN_ZPAGE LINErrCounterType LIN_ErrTxCounter;       /* Shift counter for Tx errors */
LIN_ZPAGE LINErrCounterType LIN_ErrRxCounter;       /* Shift counter for Rx errors */

#if defined(USEZEROPAGE)
#pragma DATA_SEG DEFAULT
#endif /* defined(USEZEROPAGE) */

/****************************************************************************
 * End of common-purpose RAM variables declaration
 ***************************************************************************/
#pragma CODE_SEG .lintext

#if !defined(LINAPI_1_0)

/***************************************************************************
 * Function :   LIN_GetTxErr
 *
 * Description: Return shift counter for Tx errors
 *
 * Returns:     LIN_ErrTxCounter
 *
 * Notes:       1. API call 
 **************************************************************************/
LINErrCounterType near LIN_GetTxErr( void )
{
    return LIN_ErrTxCounter;       
}

/***************************************************************************
 * Function :   LIN_GetRxErr
 *
 * Description: Return shift counter for Rx errors
 *
 * Returns:     LIN_ErrRxCounter
 *
 * Notes:       1. API call 
 **************************************************************************/
LINErrCounterType near LIN_GetRxErr( void )
{
    return LIN_ErrRxCounter;       
}

/***************************************************************************
 * Function :   LIN_ClearTxErr
 *
 * Description: Clear shift counter for Tx errors
 *
 * Returns:     none
 *
 * Notes:       1. API call
 **************************************************************************/
void near LIN_ClearTxErr( void )
{
    LIN_ErrTxCounter = 0;
}

/***************************************************************************
 * Function :   LIN_ClearRxErr
 *
 * Description: Clear shift counter for Rx errors
 *
 * Returns:     none
 *
 * Notes:       1. API call
 **************************************************************************/
void near LIN_ClearRxErr( void )
{
    LIN_ErrRxCounter = 0;
}

#endif /* !defined(LINAPI_1_0) */

#pragma CODE_SEG DEFAULT

⌨️ 快捷键说明

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