main.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 "BBox_Bcu.h"
  61. #include "Hal_Fls.h"
  62. #include "SEGGER_SYSVIEW.h"
  63. #include "cm_backtrace.h"
  64. #define APPNAME "S32K146_4G"
  65. #define HARDWARE_VERSION "V1.0.0"
  66. #define SOFTWARE_VERSION "V0.0.1"
  67. int main(void)
  68. {
  69. volatile int exit_code = 0;
  70. coreInit();
  71. SystemModulesInit();
  72. displayResetReasonWithLED();
  73. #ifdef SEGGER_SYSTEMVIEW
  74. SEGGER_SYSVIEW_Conf();
  75. SEGGER_SYSVIEW_Start();
  76. #endif
  77. #ifdef SEGGER_RTT_PRINTF
  78. SEGGER_RTT_Init();
  79. cm_backtrace_init(APPNAME, HARDWARE_VERSION, SOFTWARE_VERSION);
  80. SEGGER_RTT_printf("boot\n");
  81. #endif
  82. UartInit();
  83. xTaskCreate(MainTask, (const char *const)"MainTask", 512, (void *)0, main_TASK_PRIORITY + 6, &MainTask_Handle);
  84. //xTaskCreate(Uart0Task, (const char *const)"Uart0_Bms_Task", 512, (void *)0, main_TASK_PRIORITY + 2, Uart0Task_Handle);
  85. xTaskCreate(CanTask, (const char *const)"CanTask", 512, (void *)0, main_TASK_PRIORITY + 2, &CanTask_Handle);
  86. xTaskCreate(GpsTask, (const char *const)"GpsTask", 2048, (void *)0, main_TASK_PRIORITY + 1, &GpsTask_Handle);
  87. xTaskCreate(Uart_4G_Task, (const char *const)"Uart_4G_Task", 2048, (void *)0, main_TASK_PRIORITY + 0, &Uart_4G_Task_Handle);
  88. xTaskCreate(BBox_BCU_Task, (const char *const)"BBox_BCU_Task", 2048, (void *)0, main_TASK_PRIORITY + 3, &BBox_BCU_Task_Handle);
  89. vTaskStartScheduler();
  90. for (;;)
  91. {
  92. if (exit_code != 0)
  93. {
  94. break;
  95. }
  96. }
  97. return exit_code;
  98. }
  99. /** @} */