📄 uart1_int_main.c
字号:
#include "uart.h"
#include "register.h"
#include "int.h"
#include "io.h"
void UART1RX_ISR()
{
U8 ch;
while(1)
{
if(UartIsRxCh1()) //Rx FIFO has data
{
ch = readb(REG_URXB1);
UartTxCharCh1(ch); // send to CH1
}
else
{
break;
}
}
_ISR_END( _INT_NO_UART1RX );
}
void Logo()
{
UartPrintfCh1("\r\n");
UartPrintfCh1("\r\n***************************************");
UartPrintfCh1("\r\n Welcome to Amazon V4 Board !");
UartPrintfCh1("\r\n***************************************\r\n");
}
int main(void)
{
InitInterrupt(); // Initialize Interrupt
UartConfigCh1(DATABIT8, BPS115200); // initialize for DebugPrintf
Logo();
vgSetInterruptVector(_INT_BASE_OFFSET + _INT_NO_UART1RX, UART1RX_ISR);
vgEnableInterrupt(_INT_NO_UART1RX,TRUE);
UartPrintfCh1("\r\n\nPress any key you want to send to Board\r\n");
while(1);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -