main.c 3.1 KB

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