main.c 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : S32K3XX
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K3_RTD_1_0_0_D2110_ASR_REL_4_4_REV_0000_20211007
  12. *
  13. * (c) Copyright 2020 - 2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. /**
  25. * @file main.c
  26. * 主函数入口
  27. * @addtogroup main_module main module documentation
  28. * @{
  29. */
  30. /* Including necessary configuration files. */
  31. #include "Mcal.h"
  32. #include "CAN.h"
  33. #include "SchM_Can.h"
  34. #include "Mcu.h"
  35. #include "Mcl.h"
  36. #include "Port.h"
  37. #include "Dio.h"
  38. #include "Uart.h"
  39. #include "Eep.h"
  40. #include "Fls.h"
  41. #include "SchM_Fls.h"
  42. #include "Platform.h"
  43. #include "Lpuart_Uart_Ip_Irq.h"
  44. #include "Flexio_Uart_Ip_Irq.h"
  45. #include "Dma_Ip.h"
  46. #include "Dma_Ip_Irq.h"
  47. #include "Lpuart_Uart_Ip.h"
  48. #include "Gpt.h"
  49. #include "Wdg_43_Instance0.h"
  50. #include "Icu.h"
  51. /* User includes */
  52. #include <string.h>
  53. #include "hal_adapter.h"
  54. #include "Lpuart_Uart_Ip.h"
  55. #include "AppTaskMain.h"
  56. #include "AppTaskUart0.h"
  57. #include "AppTaskUart1.h"
  58. #include "AppTaskCan.h"
  59. #include "AppTaskGps.h"
  60. #include "BCU.h"
  61. #include "Hal_Fls.h"
  62. int main(void)
  63. {
  64. volatile int exit_code = 0;
  65. taskENTER_CRITICAL();//以下为临界区,不允许中断打断
  66. coreInit();
  67. SystemModulesInit();
  68. debugInit();
  69. UartInit();
  70. xTaskCreate(MainTask, (const char *const)"MainTask", 128, (void *)0, main_TASK_PRIORITY + 6, &MainTask_Handle);
  71. //xTaskCreate(Uart0Task, (const char *const)"Uart0_Bms_Task", 512, (void *)0, main_TASK_PRIORITY + 2, Uart0Task_Handle);
  72. xTaskCreate(CanTask, (const char *const)"CanTask", 256, (void *)0, main_TASK_PRIORITY + 2, &CanTask_Handle);
  73. xTaskCreate(GpsTask, (const char *const)"GpsTask", 2048, (void *)0, main_TASK_PRIORITY + 1, &GpsTask_Handle);
  74. xTaskCreate(Uart_4G_Task, (const char *const)"Uart_4G_Task", 1024, (void *)0, main_TASK_PRIORITY + 0, &Uart_4G_Task_Handle);
  75. xTaskCreate(BCU,(const char *const)"Bcu_Task",2048,(void *)0,main_TASK_PRIORITY + 3,&BcuTask_Handle);
  76. vTaskStartScheduler();
  77. taskEXIT_CRITICAL();
  78. for (;;)
  79. {
  80. if (exit_code != 0)
  81. {
  82. break;
  83. }
  84. }
  85. return exit_code;
  86. }
  87. /** @} */