	  //CH372外部固件模式 命令子函数 默认在24MHz下

//#include "common.h"
//#include <CH375INC.H>
//#include <usb_descriptor.h>
#include <stdio.h> 
#include <ADuC845.h>
 #include <intrins.h>
#include <UART.H>
#include "absacc.h"
#include <nRF2401.H>

sbit DR1=P3^3;
#define RCV_FIFO_LEN 25 
unsigned char  RcvFifo[ RCV_FIFO_LEN ] = {0, 0};

void main(void)
{
	unsigned char  te,tmp;
//	Delay25us(40);

// Initial for UART
	InitUART();
    Prints("////////////////////////////////////\r\n",1);


// Initial for CH375	DisConnect();
/*	Delay25us(400);
	init_CH37x();
	EXInt1_Init();
	IP=0x10;
 */
 
 // Initial for nRF2401
    nRF2401_Init();
//	  CE_High();
//	EXInt0_Init();			 // 接收方
	SetRXMode();

	while(1)
	{	  	
		   DR1=1;
		  	if(DR1==0)
				{
				 	Prints("m",1);
					 PrintHex(20) ;
				 for(te=0;te<25;te++)
				     {
					 RcvFifo[te]=SPI_RcvByte();
					 }
				
				
					tmp = RcvFifo[2];
				    PrintHex(tmp) ;
		//		    ep0_data.data_buf[ 0 ] = tmp;
				//	 Prints("t",1);
				
					tmp = RcvFifo[3];
				    PrintHex(tmp) ;
		//			ep0_data.data_buf[ 1 ] = report_x = tmp;
					
					tmp = RcvFifo[4];
				    PrintHex(tmp) ;
		//			ep0_data.data_buf[ 2 ] = report_y = tmp;

					tmp = RcvFifo[5];
			        PrintHex(tmp) ;
		//			ep0_data.data_buf[ 3 ] = tmp;

		//			CH37x_wr_usb_data5( 4 );
		
					
				} 


	      }  
	

 }
