📄 uart.c
字号:
#include "def.h"
#include "option.h"
#include <string.h>
#include "k44.h"
#include "k44lib.h"
static char *uartTxStr;
void __irq IsrUartTx(void)
{
rINTPEND=~BIT_UTXD;
//rI_ISPC; //is needed only when cache=on & wrbuf=on & BSFRD=0
if(*uartTxStr != '\0')
rTBR=(*uartTxStr++);
else
rINTMASK&=~BIT_UTXD;
}
void Test_Uart(void)
{
pISR_UTXD=(unsigned)IsrUartTx;
Uart_Printf("[Uart tx interrupt test]\n");
Uart_TxEmpty(); //wait until tx shifter is empty.
uartTxStr="UART0 Tx interrupt test is good!!!!\r\n";
//
//may need triggering character!!!
//
rINTMASK=BIT_UTXD;
Delay(3000);
rINTMASK=0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -