main.c

来自「uart 44b0 rs232 send receive」· C语言 代码 · 共 51 行

C
51
字号
#include "../inc/option.h"
#include "../inc/def.h"
#include "../inc/44b.h"
#include "../inc/44blib.h"

void main(void)
{
    U8 aa;
    
    ChangePllValue(PLL_M,PLL_P,PLL_S);
    Delay(0);  //calibrate Delay()

   
    rINTCON=0x5;	  // Non-vectored,IRQ enable,FIQ disable    
    rINTMOD=0x0;	  // All=IRQ mode
    rINTMSK|=BIT_GLOBAL|BIT_EINT3;	  // All interrupt is masked.
    //Port_Init();
    Uart_Init(0,115200);
    Uart_Select(0);    
    
    Uart_Printf("\n start");
    Uart_Printf("\nHello,FS44B0X!");
    Uart_Printf("\nPlease Press 'a'or'b'or'c'");

     while(1)
    {       
    	     aa= Uart_Getch();
	    //scanf("%s",aa);
	    switch(aa)
	        {
	    	case 'a':
	    	    Uart_Printf("\nYou Pressed 'a'");
	    	    //Led_Display(0x1);
	    	    break;
	    	case 'b':
	    	    Uart_Printf("\nYou Pressed 'b'");
	    	    //Led_Display(0x2);
	    	    break;
	    	case 'c':
	            Uart_Printf("\nYou Pressed 'c'");
	    	    //Led_Display(0x4);
	    	    //isExit = 0;
	    	    break;
	    	default :
	    	    break;
	        }
    }
}


⌨️ 快捷键说明

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