Main.#2
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:3k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. //-----------------------------------------------------------------------------
  2. // Main.c
  3. //-----------------------------------------------------------------------------
  4. // Copyright 2007 Vson Technology, Inc.
  5. // http://www.usbmcu.com
  6. //
  7. // Program Description:
  8. //
  9. //
  10. //
  11. //
  12. //
  13. // MCU:            C8051F347
  14. // Tool chain:     Keil C51 7.50 / Keil EVAL C51
  15. //                 Silicon Laboratories IDE version 2.6
  16. // Command Line:   
  17. // Project Name:   TR1000
  18. //
  19. //
  20. // Release 1.0
  21. //    -All changes by Brin Cai
  22. //    -24 JUL 2007
  23. //
  24. //
  25. //
  26. //update date: 
  27. //2007.10.24 
  28. // 1.对于学生机:只做包序比较--》比较ID号和包序号 解决时分复用问题
  29. // 2.对于教师机:没有做更改,一个教室教师机只有一个,所有没有ID号的区别
  30. //2007.08.13 ADC solution bit change(10bit--->12bit)
  31. //-----------------------------------------------------------------------------
  32. // Includes
  33. //-----------------------------------------------------------------------------
  34. #include "Include_H.h"
  35. //-----------------------------------------------------------------------------
  36. // Main.c Globals Variables
  37. //-----------------------------------------------------------------------------
  38. DEVICE_STATUS    gDeviceStatus;
  39. EP_STATUS        gEp0Status;
  40. EP_STATUS        gEp1InStatus;
  41. EP_STATUS        gEp2OutStatus;
  42. EP0_COMMAND      gEp0Command;
  43. //-----------------------------------------------------------------------------
  44. // MAIN Routine
  45. //-----------------------------------------------------------------------------
  46. void main (void)
  47. {
  48.    
  49.    PCA0MD &= ~0x40;                    // Disable Watchdog timer
  50.    Initial();
  51.    EA = 1;                             // Enable global interrupts
  52.    USB0_Enable ();                     // Enable USB0
  53.    //RF_DATA_PORT_OUT_INITIAL; //delete at 2007.10.09
  54.    //nRF2401Configuration();
  55.    RF_DATA_PORT_IN_INITIAL;
  56.    while (1)
  57.    {
  58.       gbitRfReceivedDataFlag = nRF2401RxData();
  59.   State_Machine();
  60.   if (0)//(1 == gbitClearStudentIdBuffer)
  61.   {
  62.      ClearStudentIdBuffer();
  63.  gbitClearStudentIdBuffer = 0;
  64.  StopTimer2();
  65.   }
  66.   
  67.    }//while
  68. }//main
  69. //-----------------------------------------------------------------------------
  70. // USB0_Enable
  71. //-----------------------------------------------------------------------------
  72. //
  73. // Return Value : None
  74. // Parameters   : None
  75. //
  76. // This function enables the USB transceiver
  77. //
  78. //-----------------------------------------------------------------------------
  79. void USB0_Enable (void)
  80. {
  81.    UWRITE_BYTE(POWER, 0x00);           // Enable USB0 by clearing the
  82.                                        // USB Inhibit bit
  83.                                        // Suspend mode disabled
  84. }
  85. //-----------------------------------------------------------------------------
  86. // End Of File
  87. //-----------------------------------------------------------------------------