📄 linerr.h
字号:
#ifndef LINERR_H
#define LINERR_H
/******************************************************************************
*
* Copyright (C) 2003 Motorola, Inc.
* All Rights Reserved
*
* Filename: $RCSfile: linerr.h,v $
* Author: $Author: ttz778 $
* Locker: $Locker: $
* State: $State: Exp $
* Revision: $Revision: 1.0 $
*
* Functions: LIN Error module header file
*
* History: Use the RCS command log to display revision history
* information.
*
* Description:
*
* Notes:
*
******************************************************************************/
/****************************************************************************
* All extern declarations of common-purpose RAM variables shall be here.
***************************************************************************/
extern LINErrCounterType LIN_ErrTxCounter; /* Shift counter for Tx errors */
extern LINErrCounterType LIN_ErrRxCounter; /* Shift counter for Rx errors */
/****************************************************************************/
/*** Macros ***/
/****************************************************************************/
#define LIN_ShiftRxErr() LIN_ErrRxCounter >>= 1
#define LIN_ShiftTxErr() LIN_ErrTxCounter >>= 1
/**************************************************************************
* Function : LIN_SetRxErr
*
* Description: Shift Rx error counter and set high bit
*
* Returns: none
*
* Notes: none
*
**************************************************************************/
#if defined(CW08)
#define LIN_SetRxErr() \
asm SEC; \
asm LDHX @LIN_ErrRxCounter; \
asm ROR ,X
#endif /* defined(CW08) */
#if defined(COSMIC08)
#define LIN_SetRxErr() \
_asm ("xref _LIN_ErrRxCounter"); \
_asm ("SEC"); \
_asm ("LDHX #_LIN_ErrRxCounter"); \
_asm ("ROR ,X")
#endif /* defined(COSMIC08) */
/**************************************************************************
* Function : LIN_SetTxErr
*
* Description: Shift Tx error counter and set high bit
*
* Returns: none
*
* Notes: none
*
**************************************************************************/
#if defined(CW08)
#define LIN_SetTxErr() \
asm SEC; \
asm LDHX @LIN_ErrTxCounter; \
asm ROR ,X
#endif /* defined(CW08) */
#if defined(COSMIC08)
#define LIN_SetTxErr() \
_asm ("xref _LIN_ErrTxCounter"); \
_asm ("SEC"); \
_asm ("LDHX #_LIN_ErrTxCounter"); \
_asm ("ROR ,X")
#endif /* defined(COSMIC08) */
#endif /* !define (LINERR_H) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -