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

📄 linerr.c

📁 飞思卡尔车身控制技术研讨会资料 里面有LIN的主从节点源程序
💻 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 declared using LIN_ZPAGE
 * modifier.
 * It require to perform zero page RAM placement optimisation.
 ***************************************************************************/
#if defined(S08) && defined(CW08)
#pragma DATA_SEG SHORT ZeroSeg
#endif /* defined(S08) && defined(CW08) */

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

#if defined(S08) && defined(CW08)
#pragma DATA_SEG DEFAULT
#endif /* defined(S08) && defined(CW08) */
/****************************************************************************
 * End of common-purpose RAM variables declaration
 ***************************************************************************/


#if !defined(LINAPI_1_0)

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

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

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

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

#endif /* !defined(LINAPI_1_0) */

⌨️ 快捷键说明

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