CanVar.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * CanVar.c
  3. *
  4. * Created on: 2021年12月27日
  5. * 编码
  6. * Author: QiXiang_CHENJIE
  7. */
  8. #include "CanVar.h"
  9. /************************************************************
  10. *CAN0->BMC解码变量存放区
  11. ************************************************************/
  12. UINT32 Can0InTable[2] =
  13. {
  14. 0x18FF5A51,
  15. 0x18FF5A52,
  16. };
  17. BOOL Can0RxShortError[2];
  18. BOOL Can0RxLongError[2];
  19. UINT8 Can0RxErrorCounter[2];
  20. UINT8 Can0RxFlag[2];
  21. UINT8 gashighLevel_gf1 = 0;
  22. UINT8 gaslowLevel_gf1 = 0;
  23. UINT8 temp_gf1 = 0;
  24. UINT8 warningLevel_gf1 = 0;
  25. UINT8 workMode_gf1 = 0;
  26. UINT8 fumesHigh_gf1 = 0;
  27. UINT8 fumesLow_gf1 = 0;
  28. UINT8 gashighLevel_gf2 = 0;
  29. UINT8 gaslowLevel_gf2 = 0;
  30. UINT8 temp_gf2 = 0;
  31. UINT8 warningLevel_gf2 = 0;
  32. UINT8 workMode_gf2 = 0;
  33. UINT8 fumesHigh_gf2 = 0;
  34. UINT8 fumesLow_gf2 = 0;
  35. /************************************************************
  36. *CAN1->BMC解码变量存放区
  37. ************************************************************/
  38. UINT32 Can1InTable[1] =
  39. {
  40. 0x18FF1200,
  41. };
  42. BOOL Can1RxShortError[1];
  43. BOOL Can1RxLongError[1];
  44. UINT8 Can1RxErrorCounter[1];
  45. UINT8 Can1RxFlag[1];
  46. UINT8 chrgModulePwrCtrl = 0; //充电模块总电源控制(交流接触器)XK36输出控制
  47. UINT8 baseSwitchCtrl = 0; //底座/充电枪切换总控制(0X1切换到枪,充电停止状态可动作。0X0切换到底座,充电停止状态可动作。)
  48. UINT8 paraChrgCtrlState = 0; //充电机并充控制状态
  49. UINT8 chrgStartState = 0; //充电开始状态
  50. UINT8 chrgStopState = 0; //充电停止状态
  51. /************************************************************
  52. *BMC->CAN1解码变量存放区
  53. ************************************************************/
  54. UINT32 Can1OutTable[4][4] =
  55. {
  56. {0x18FF1100, 100},
  57. {0x18FF1101, 100},
  58. {0x18FF1102, 100},
  59. {0x18FF1103, 100}
  60. };
  61. UINT8 connectorHvlock1 = 0; //动力连接器互锁信号1
  62. UINT8 connectorHvlock2 = 0; //动力连接器互锁信号2
  63. UINT8 chrgModuelPwrCtlFB = 0; //充电模块总电源控制反馈
  64. UINT8 paraChrgCtlFB = 0; //并充控制状态反馈
  65. UINT8 outToChrgCtlFB_A = 0; // A路至充电枪输出状态反馈
  66. UINT8 outToBaseCtlFB_A = 0; // A路至底座输出状态反馈
  67. UINT8 outToChrgCtlFB_B = 0; // B路至充电枪输出状态反馈
  68. UINT8 outToBaseCtlFB_B = 0; // B路至底座输出状态反馈
  69. UINT8 fuseActionFB_A = 0; // A路熔断器熔断反馈
  70. UINT8 fuseActionFB_B = 0; // B路熔断器熔断反馈
  71. UINT8 sigSwitchReadyFB_A = 0; // A路信号切换到位状态反馈
  72. UINT8 sigSwitchReadyFB_B = 0; // B路信号切换到位状态反馈
  73. UINT8 ctrlFXFB1 = 0; //执行气溶胶灭火装置1反馈
  74. UINT8 ctrlFXFB2 = 0; //执行气溶胶灭火装置2反馈
  75. UINT8 conn1Temp1 = 0; //动力连接器1温度检测1
  76. UINT8 conn1Temp2 = 0; //动力连接器1温度检测2
  77. UINT8 conn2Temp1 = 0; //动力连接器2温度检测1
  78. UINT8 conn2Temp2 = 0; //动力连接器2温度检测2
  79. UINT8 chrgGunTemp1_A = 0; // A充电枪温度检测1
  80. UINT8 chrgGunTemp2_A = 0; // A充电枪温度检测2
  81. UINT8 chrgGunTemp1_B = 0; // B充电枪温度检测1
  82. UINT8 chrgGunTemp2_B = 0; // B充电枪温度检测2
  83. UINT8 chrgBoxTemp1 = 0; //充电仓温度1
  84. UINT8 chrgBoxTemp2 = 0; //充电仓温度2
  85. UINT8 chrgBoxGasOver1 = 0; //充电仓气体高 1
  86. UINT8 chrgBoxGasOver2 = 0; //充电仓气体高 2
  87. UINT8 chrgBoxFumesOver1 = 0; //充电仓烟雾高1
  88. UINT8 chrgBoxFumesOver2 = 0; //充电仓烟雾高2
  89. UINT8 chrgBox1Warning = 0; //充电仓1预警等级
  90. UINT8 chrgBox2Warning = 0; //充电仓2预警等级
  91. #define EEPDATA_START_SEC_VAR
  92. #include "MemMap.h"
  93. /*存储数据区*/
  94. #define EEPDATA_STOP_SEC_VAR
  95. #include "MemMap.h"
  96. #define APPLAYERVER_START_SEC_VAR
  97. #include "MemMap.h"
  98. const uint8 T_table[240] = {239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
  99. 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203,
  100. 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182,
  101. 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161,
  102. 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
  103. 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119,
  104. 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97,
  105. 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69,
  106. 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41,
  107. 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13,
  108. 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  109. const uint32 R_table[240] = {125, 127, 129, 131, 133, 136, 138, 141, 143, 145, 148, 151, 153, 156, 159, 162, 165,
  110. 168, 171, 174, 177, 180, 183, 187, 190, 194, 198, 201, 205, 209, 213, 217, 221, 226, 230, 234, 239, 244, 249,
  111. 254, 259, 264, 269, 274, 280, 286, 292, 298, 304, 310, 316, 323, 330, 337, 344, 351, 359, 366, 374, 382, 391,
  112. 399, 408, 417, 426, 436, 445, 455, 466, 476, 487, 498, 509, 521, 533, 546, 558, 571, 585, 599, 613, 627, 642,
  113. 658, 674, 690, 707, 724, 742, 760, 779, 799, 819, 839, 861, 883, 905, 928, 952, 977, 1002, 1029, 1056, 1083,
  114. 1112, 1142, 1172, 1204, 1236, 1270, 1305, 1340, 1377, 1415, 1455, 1495, 1537, 1581, 1626, 1672, 1720, 1769,
  115. 1821, 1874, 1928, 1985, 2044, 2104, 2167, 2232, 2299, 2369, 2441, 2515, 2592, 2672, 2755, 2841, 2931, 3023,
  116. 3119, 3218, 3321, 3428, 3539, 3654, 3773, 3898, 4026, 4160, 4299, 4443, 4593, 4749, 4911, 5080, 5255, 5438,
  117. 5627, 5825, 6030, 6244, 6466, 6698, 6940, 7191, 7454, 7727, 8012, 8309, 8619, 8942, 9280, 9632, 10000, 10383,
  118. 10784, 11203, 11641, 12098, 12577, 13077, 13600, 14147, 14720, 15319, 15947, 16604, 17293, 18015, 18771,
  119. 19564, 20395, 21268, 22183, 23144, 24152, 25211, 26324, 27493, 28722, 30014, 31373, 32802, 34307, 35891,
  120. 37558, 39315, 41166, 43117, 45174, 47343, 49633, 52049, 54599, 57293, 60140, 63148, 66329, 69693, 73252,
  121. 77019, 81008, 85233, 89710, 94455, 99488, 104827, 110493, 116508, 122898, 129687, 136905, 144580,
  122. 152746, 161438, 170694, 180554, 191063, 202269};
  123. #define APPLAYERVER_STOP_SEC_VAR
  124. #include "MemMap.h"