- //-----------------------------------------------------------------------------
- // Main.c
- //-----------------------------------------------------------------------------
- // Copyright 2007 Vson Technology, Inc.
- // http://www.usbmcu.com
- //
- // Program Description:
- //
- //
- //
- //
- //
- // MCU: C8051F347
- // Tool chain: Keil C51 7.50 / Keil EVAL C51
- // Silicon Laboratories IDE version 2.6
- // Command Line:
- // Project Name: TR1000
- //
- //
- // Release 1.0
- // -All changes by Brin Cai
- // -24 JUL 2007
- //
- //
- //
- //update date:
- //2007.11.30 学生按键接收缓冲大小 由20 改为 60
- //2007.10.24
- // 1.对于学生机:只做包序比较--》比较ID号和包序号 解决时分复用问题
- // 2.对于教师机:没有做更改,一个教室教师机只有一个,所有没有ID号的区别
- //2007.08.13 ADC solution bit change(10bit--->12bit)
- //-----------------------------------------------------------------------------
- // Includes
- //-----------------------------------------------------------------------------
- #include "Include_H.h"
- //-----------------------------------------------------------------------------
- // Main.c Globals Variables
- //-----------------------------------------------------------------------------
- DEVICE_STATUS gDeviceStatus;
- EP_STATUS gEp0Status;
- EP_STATUS gEp1InStatus;
- EP_STATUS gEp2OutStatus;
- EP0_COMMAND gEp0Command;
- //-----------------------------------------------------------------------------
- // MAIN Routine
- //-----------------------------------------------------------------------------
- void main (void)
- {
- PCA0MD &= ~0x40; // Disable Watchdog timer
- Initial();
- EA = 1; // Enable global interrupts
- USB0_Enable (); // Enable USB0
- //RF_DATA_PORT_OUT_INITIAL; //delete at 2007.10.09
- //nRF2401Configuration();
- RF_DATA_PORT_IN_INITIAL;
- while (1)
- {
- gbitRfReceivedDataFlag = nRF2401RxData();
- State_Machine();
- if (1 == gbitClearStudentIdBuffer)
- {
- ClearStudentIdBuffer();
- gbitClearStudentIdBuffer = 0;
- StopTimer2();
- }
- }//while
- }//main
- //-----------------------------------------------------------------------------
- // USB0_Enable
- //-----------------------------------------------------------------------------
- //
- // Return Value : None
- // Parameters : None
- //
- // This function enables the USB transceiver
- //
- //-----------------------------------------------------------------------------
- void USB0_Enable (void)
- {
- UWRITE_BYTE(POWER, 0x00); // Enable USB0 by clearing the
- // USB Inhibit bit
- // Suspend mode disabled
- }
- //-----------------------------------------------------------------------------
- // End Of File
- //-----------------------------------------------------------------------------