AppGlobalVar.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * @Author: chenjie
  3. * @Date: 2022-06-06
  4. * @LastEditTime: 2022-10-27
  5. * @LastEditors: chenjie
  6. * @Description:
  7. * @FilePath: \S32K146_4G\code\app\AppGlobalVar.c
  8. * Copyright (c) 2022 by chenjie, All Rights Reserved.
  9. */
  10. /*
  11. * AppGlobalVar.c
  12. *应用层全局变量
  13. * Created on: 2022年1月19日
  14. * Author: QiXiang_CHENJIE
  15. */
  16. #include "AppGlobalVar.h"
  17. //#define APP_RELEASE
  18. #ifdef APP_RELEASE
  19. const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
  20. uint16 WebSitePort = 8712;
  21. #else
  22. const char WebSiteName[] = "\"nas.fast-fun.cn\"";
  23. uint16 WebSitePort = 8812;
  24. #endif
  25. #define defaultSn "SPFPFL264S226D001"
  26. const uint32 AppSwVersion = 0x00000108;
  27. const uint8 DataModuleType = 0x02;//01=NB,02-4G
  28. const uint16 HwVersion = 0x001;
  29. const uint32 BlSwVersion = 0x00000001;
  30. const uint32 DrvSwVersion = 0x00000001;
  31. const uint8 BmsManuFacture = 0xff;
  32. const uint8 BmsInfo = 0xff;
  33. uint8 TcpbattSN[BATT_SN_LEN] = {0x31};
  34. volatile uint32 TimerCounter = 0; // ms单位
  35. uint8 Fota_update_flag = 0;
  36. uint8 Fota_error_flag = 0;
  37. /*GPS*/
  38. QueueHandle_t GpsDataQueueHandle;
  39. sint16 xyzData[3] = {0};
  40. /*Hal_Can*/
  41. uint8 CanIf_u8TxConfirmCnt = 0U;
  42. boolean CanIf_bTxFlag = false;
  43. uint8 CanIf_u8RxIndicationCnt = 0U;
  44. boolean CanIf_bRxFlag = false;
  45. QueueHandle_t CanRecvQueueHandle;
  46. /*TCP相关变量*/
  47. bool TcpSysReboot = 1; // tcp无法联网时,重启使能
  48. char ImeiNum[15] = {0};
  49. char IccidNum[20] = {0};
  50. uint8 CSQValue = 0;
  51. sint8 SocketId = -1; // 联网状态
  52. sint8 RegChkRet = 0; // 驻网状态
  53. char WebSiteIp[20] = {0};
  54. uint8 TcpWorkState = 0;
  55. #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
  56. #include "Eep_MemMap.h"
  57. AppConfigBody AppConfigInfo = {false, true, {defaultSn}, {0}};
  58. #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
  59. #include "Eep_MemMap.h"
  60. /*以下变量均为串口协议相关变量*/
  61. #ifdef APP_UART0_ENABLE
  62. AppDataBody AppDataInfo = {BMS_CELLNUM, BMS_TEMPNUM};
  63. uint16 avrgCellVol = 0; // 平均电压
  64. uint16 bmsHwVersion = 0;
  65. uint32 bmsSwVersion = 0;
  66. uint16 battCellU[BMS_CELLNUM]; // 电池电压
  67. uint16 battI = 10000; // BMS电流(tcp上传)
  68. uint16 battPackVol = 0; // bms电压
  69. uint16 maxCellVol = 0; // 最大单体电压
  70. uint16 minCellVol = 0; // 最小单体电压
  71. // uint16 socd_pct_vcuSoc = 0; // soc(tcp上传,精度0.1)
  72. // uint16 sohd_pct_bcuSoh = 0; // soh(tcp上传,精度0.1)
  73. uint32 battBalanceoInfo = 0; //
  74. uint32 battProtectState = 0; // bms保护状态
  75. uint32 battWarningState = 0; // bms告警状态
  76. uint8 AvgBattTemp = 0; // 平均单体温度
  77. uint8 battCellTemp[BMS_TEMPNUM]; // 电池温度
  78. uint8 Battdesigncap = 0; // 电池包设计容量
  79. uint8 battHeatEnableState = 0; // bms加热状态
  80. uint8 battMOSSwitchState = 0; // bms mos开关状态
  81. uint8 battSOC = 0; // bms发送soc
  82. uint8 battSOH = 0; // bms发送soh
  83. uint8 battWorkState = 0; // bms工作状态
  84. uint8 BmsOtherTemp = 0; // BMS其他温度,没有其他温度,为0
  85. uint8 maxCellTemp = 0; // 最大单体温度
  86. uint8 minCellTemp = 0; // 最小单体温度
  87. uint8 OtherTemp = 0; // 通讯模块其他温度
  88. uint8 battHeatState = 0;
  89. uint8 battFanState = 0;
  90. uint8 battRelayState = 0;
  91. uint8 battConverState = 0;
  92. uint8 battSeparateEnable = 0;
  93. uint8 battSeparateCtlState = 0;
  94. uint8 battSeparateState = 0;
  95. uint16 ErrorArray[5] = {0};
  96. uint32 meterAllPwr[2] = {0};
  97. uint32 meterPosPwr[2] = {0};
  98. uint32 meterNegPwr[2] = {0};
  99. uint32 BattTempR[4] = {0xFF};
  100. #endif