www.pudn.com > RS485_USART-ok.rar > main.c, change:2008-12-15,size:1006b


// main.c 
#include "includes.h" 
#include "stdio.h" 
 
//#include <stdio.h> 
 
 
void DelayNS(unsigned long  dly); 
extern int LTC1859_Cmd_Buf[8]; 
    INT32U freq[2];  
 
int main() 
{    
    
      // 屏蔽所有中断 
    //AT91C_BASE_AIC->AIC_IDCR = 0xFFFFFFFF;   
   char Tx_Buff[30]= "shen zhen anche:";  
 
  
    PLL_Init();     
    US_Init();    
    while(1) 
    {    
      if( PCRxBuf1[0] == 0x01)   
      { 
       Usart_Send(Tx_Buff); 
       Usart_Send("  20081212\n");   
                 
      } 
      DelayNS(1); 
             
    } 
     
          
     
} 
 
/**************************************************************************** 
* 名称:DelayNS() 
* 功能:长软件延时 
* 入口参数:dly     延时参数,值越大,延时越久 
* 出口参数:无 
****************************************************************************/ 
  void  DelayNS(unsigned long  dly) 
  { 
     unsigned long  i; 
   
     for(; dly>0; dly--)  
        for(i=0; i<50; i++); 
  }