comm_51.c
来自「串口通信构件」· C语言 代码 · 共 68 行
C
68 行
/*
*********************************************************************************************************
* Embedded Systems Building Blocks
* Complete and Ready-to-Use Modules in C
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDES
*********************************************************************************************************
*/
#include "..\includes\INCLUDES.H"
extern bit SemTIbusy;
/*
*********************************************************************************************************
* CONSTANTS
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/
#if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
extern OS_CPU_SR cpu_sr;
#endif
/*
*********************************************************************************************************
* COMM ISR HANDLER
*串行口通信中断程序
* Description : This function processes an interrupt from a COMM port. The function verifies whether the
* interrupt comes from a received character, the completion of a transmitted character or
* both.
* Notes : 'switch' statements are used for expansion.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* DISABLE TX INTERRUPTS
*
* Description : This function disables the character transmission.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* ENABLE TX INTERRUPTS
*
* Description : This function enables transmission of characters. Transmission of characters is
* interrupt driven. If you are using a multi-drop driver, the code must enable the driver
* for transmission.
*********************************************************************************************************
*/
void CommTxIntEn ()
{
//OS_ENTER_CRITICAL();
TI = 1; /* Enable IRQ */
SemTIbusy = 1;
//OS_EXIT_CRITICAL();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?