main.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /****************************************Copyright (c)****************************************************
  2. **
  3. ** http://www.powermcu.com
  4. **
  5. **--------------File Info---------------------------------------------------------------------------------
  6. ** File name: main.c
  7. ** Descriptions: The UCOSII application function
  8. **
  9. **--------------------------------------------------------------------------------------------------------
  10. ** Created by: AVRman
  11. ** Created date: 2010-11-9
  12. ** Version: v1.0
  13. ** Descriptions: The original version
  14. **
  15. **--------------------------------------------------------------------------------------------------------
  16. ** Modified by:
  17. ** Modified date:
  18. ** Version:
  19. ** Descriptions:
  20. **
  21. *********************************************************************************************************/
  22. /* Includes ------------------------------------------------------------------*/
  23. #include "includes.h"
  24. /**********************************************************************************************************
  25. * main()
  26. *
  27. * Description : This is the standard entry point for C code. It is assumed that your code will call
  28. * main() once you have performed all necessary initialization.
  29. *
  30. * Argument(s) : none.
  31. *
  32. * Return(s) : none.
  33. **********************************************************************************************************/
  34. extern unsigned char g_ucTickFlag;
  35. extern unsigned char g_ucSecFlag;
  36. int main (void)
  37. {
  38. Uart1Init();
  39. if (SysTick_Config(SystemCoreClock / 100)){
  40. while (1);
  41. }
  42. W25Q64_Init();
  43. FileSysInit();
  44. //IapTrace(IAP_VERSION_NAME);
  45. g_ucRand=GetRandBySTM32ID();
  46. memset(&sutMsg,0,sizeof(SUT_MSG));
  47. NewTask(TASK_WAIT);
  48. //NewTask(TASK_DL_APP);
  49. CopyFileInit();
  50. while(1)
  51. {
  52. if(sutMsg.Uart1Recv){ //Use for PC
  53. Uart1Msg();
  54. sutMsg.Uart1Recv=0;
  55. memset(IapRxBuf,0,sizeof(IapRxBuf));
  56. }
  57. if(sutMsg.TaskStart){
  58. sutMsg.TaskStart=0;
  59. StartMsg();
  60. }
  61. if(sutMsg.Tick10ms){
  62. sutMsg.Tick10ms=0;
  63. TickMsg();
  64. }
  65. if(sutMsg.Tick500ms){
  66. sutMsg.Tick500ms=0;
  67. Tick500Msg();
  68. }
  69. }
  70. return (0);
  71. }
  72. //void assert_failed(uint8_t* file, uint32_t line)
  73. //{
  74. // printf("[AF]f:%s,l:%d\r\n",file,line);
  75. // while (1)
  76. // {}
  77. //}
  78. /*********************************************************************************************************
  79. END FILE
  80. *********************************************************************************************************/