Primary.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. #include <stdio.h> /*標準輸入輸出定義*/
  2. #include <stdlib.h> /*標準函數庫定義*/
  3. #include <string.h>
  4. #include <stdint.h>
  5. #include "../Config.h"
  6. #include "../Log/log.h"
  7. #include "../Define/define.h"
  8. #include "../ShareMemory/shmMem.h"
  9. #include "../SelectGun/SelectGun.h"
  10. #include "main.h"
  11. #include "../timeout.h"
  12. struct SysInfoData *pSysInfo = NULL;
  13. struct ChargingInfoData *pDcChargingInfo = NULL;
  14. struct SysConfigData *pSysConfig = NULL;
  15. //------------------------------------------------------------------------------
  16. typedef struct StLedConfig {
  17. //OutputDrvValue[0]
  18. uint8_t LeftButtonLed: 1; //bit 0, H: ON, L:OFF
  19. uint8_t RightButtonLed: 1; //bit 1, H: ON, L:OFF
  20. uint8_t GreenLED: 1; //bit 2, H: ON, L:OFF
  21. uint8_t YellowLED: 1; //bit 3, H: ON, L:OFF
  22. uint8_t RedLED: 1; //bit 4, H: ON, L:OFF
  23. uint8_t SystemLed4: 1; //bit 5, H: ON, L:OFF
  24. uint8_t AcContactor: 1; //bit 6, H: ON, L:OFF
  25. uint8_t Reserved: 1; //bit 7 reserved
  26. } LedConfig;
  27. //------------------------------------------------------------------------------
  28. void ChangeLCM(uint8_t page)
  29. {
  30. pSysInfo->SystemPage = page;
  31. }
  32. // ***********************************
  33. // Enter LCM Page
  34. // ***********************************
  35. void EnterViewPage()
  36. {
  37. ChangeLCM(_LCM_VIEW);
  38. StopSystemTimeoutDet();
  39. }
  40. void EnterAuthorizePage(uint8_t gunIndex)
  41. {
  42. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
  43. log_info("Select Gun(%d) in Authorizing",gunIndex);
  44. ClearDetectPluginFlag();
  45. ChangeGunSelectByIndex(gunIndex);
  46. confirmSelGun(gunIndex);
  47. ChangeLCM(_LCM_START_SCAN);
  48. strcpy((char *)pSysConfig->UserId, "");
  49. setChargerMode(gunIndex,MODE_AUTHORIZING);
  50. StartSystemTimeoutDet(Timeout_ReturnViewPage);
  51. }
  52. void EnterLinkErrorPage()
  53. {
  54. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
  55. //ClearDetectPluginFlag();
  56. StopSystemTimeoutDet();
  57. //StopGunInfoTimeoutDet(pSysInfo->CurGunSelected);
  58. ChangeLCM(_LCM_LINK_ERROR);
  59. StartSystemTimeoutDet(Timeout_ReturnViewPage);
  60. //StartGunInfoTimeoutDet(pSysInfo->CurGunSelected,Timeout_LinkError);
  61. }
  62. /*
  63. void EnterDetailViewPage(uint8_t gunIndex)
  64. {
  65. log_info("Show Gun(%d) Detail View",gunIndex);
  66. ChangeGunSelectByIndex(gunIndex);
  67. ChangeLCM(_LCM_DETAIL_VIEW);
  68. StopGunInfoTimeoutDet(gunIndex);
  69. StartGunInfoTimeoutDet(gunIndex,Timeout_DetailView);
  70. }
  71. void EnterAuthorizeStopPage()
  72. {
  73. log_info("Select Gun(%d) in Stopping",pSysInfo->CurGunSelected);
  74. StopGunInfoTimeoutDet(pSysInfo->CurGunSelected);
  75. StopSystemTimeoutDet();
  76. strcpy((char *)pSysConfig->UserId, "");
  77. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
  78. if (pDcChargingInfo->isRemoteStart) {
  79. pSysInfo->SystemPage = _LCM_STOP_APP;
  80. } else {
  81. pSysInfo->SystemPage = _LCM_STOP_RFID;
  82. }
  83. StartSystemTimeoutDet(Timeout_ReturnViewPage);
  84. }
  85. */
  86. void StopChargingBtn(uint8_t gunIndex)
  87. {
  88. pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
  89. pDcChargingInfo->SystemStatus = S_TERMINATING;
  90. log_info("Press Button to Stop Charging");
  91. }
  92. void EnterSummaryPage()
  93. {
  94. StopSystemTimeoutDet();
  95. log_info("Showing Summary Page");
  96. pSysInfo->SystemPage = _LCM_SUMMARY;
  97. }
  98. // *****************************
  99. // Enter System status
  100. // *****************************
  101. void ReturnIDLE(uint8_t gunIndex)
  102. {
  103. log_info("Gun(%d) return to IDLE",gunIndex);
  104. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
  105. StopSystemTimeoutDet();
  106. StopGunInfoTimeoutDet(gunIndex);
  107. setChargerMode(gunIndex,MODE_IDLE);
  108. EnterViewPage();
  109. //destroySelGun(gunIndex);
  110. }
  111. void ReturnAuthorize()
  112. {
  113. StopSystemTimeoutDet();
  114. EnterAuthorizePage(pSysInfo->CurGunSelected);
  115. }
  116. void showConfirmStopPage(uint8_t gunIndex)
  117. {
  118. StopSystemTimeoutDet();
  119. ChangeGunSelectByIndex(gunIndex);
  120. log_info("Enter Confirm stop Page");
  121. pSysInfo->SystemPage = _LCM_CONFIRM_STOP;
  122. StartSystemTimeoutDet(Timeout_ReturnViewPage);
  123. }
  124. void CheckLeftButton()
  125. {
  126. DcCommonInfo* ShmDcCommonData = (DcCommonInfo*)GetShmDcCommonData();
  127. uint8_t gunIndex = 0;
  128. switch (pSysInfo->SystemPage) {
  129. case _LCM_VIEW:
  130. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(LEFT_GUN_NUM);
  131. pSysInfo->CurGunSelected = LEFT_GUN_NUM;
  132. if(pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION) {
  133. EnterAuthorizePage(LEFT_GUN_NUM);
  134. pSysInfo->SystemPage = _LCM_START_SCAN;
  135. } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
  136. showConfirmStopPage(LEFT_GUN_NUM);
  137. } else if (pDcChargingInfo->SystemStatus == S_ALARM) {
  138. // 有進入充電時
  139. if (ShmDcCommonData->isIntoCharge[LEFT_GUN_NUM]) {
  140. // 有插槍時顯示錯誤畫面
  141. if (pDcChargingInfo->ConnectorPlugIn) {
  142. pSysInfo->SystemPage = _LCM_ERROR;
  143. } else {
  144. // 未插槍時顯示結算畫面
  145. pSysInfo->SystemPage = _LCM_SUMMARY;
  146. }
  147. } else {
  148. // 未進入充電時顯示連線錯誤
  149. StopSystemTimeoutDet();
  150. StartSystemTimeoutDet(Timeout_LinkError);
  151. pSysInfo->SystemPage = _LCM_LINK_ERROR;
  152. }
  153. }
  154. break;
  155. case _LCM_START_SCAN:
  156. case _LCM_START_AUTHORIZE_FAIL:
  157. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM) {
  158. ReturnIDLE(pSysInfo->CurGunSelected);
  159. }
  160. break;
  161. case _LCM_LINK_ERROR:
  162. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM) {
  163. if (pDcChargingInfo->ConnectorPlugIn) {
  164. pSysInfo->SystemPage = _LCM_WAIT_PLUGOUT;
  165. StopSystemTimeoutDet();
  166. StartSystemTimeoutDet(Timeout_PlugOut);
  167. } else
  168. ReturnIDLE(pSysInfo->CurGunSelected);
  169. }
  170. break;
  171. case _LCM_SUMMARY:
  172. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM)
  173. break;
  174. log_info("Return View Page");
  175. ReturnIDLE(pSysInfo->CurGunSelected);
  176. break;
  177. case _LCM_ERROR:
  178. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM)
  179. break;
  180. if (pDcChargingInfo->ConnectorPlugIn)
  181. pSysInfo->SystemPage = _LCM_WAIT_PLUGOUT;
  182. else
  183. pSysInfo->SystemPage = _LCM_SUMMARY;
  184. break;
  185. case _LCM_CONFIRM_STOP:
  186. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM) {
  187. StopChargingBtn(LEFT_GUN_NUM);
  188. } else {
  189. EnterViewPage();
  190. }
  191. break;
  192. case _LCM_WAIT_PLUGIN:
  193. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM)
  194. ReturnIDLE(LEFT_GUN_NUM);
  195. break;
  196. case _LCM_WAIT_PLUGOUT:
  197. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM) {
  198. if (pDcChargingInfo->ConnectorPlugIn && pDcChargingInfo->SystemStatus == S_ALARM) {
  199. pSysInfo->SystemPage = _LCM_VIEW;
  200. }
  201. }
  202. break;
  203. }
  204. }
  205. void CheckRightButton()
  206. {
  207. uint8_t gunIndex = 0;
  208. DcCommonInfo* ShmDcCommonData = (DcCommonInfo*)GetShmDcCommonData();
  209. switch (pSysInfo->SystemPage) {
  210. case _LCM_VIEW:
  211. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(RIGHT_GUN_NUM);
  212. pSysInfo->CurGunSelected = RIGHT_GUN_NUM;
  213. if(pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION) {
  214. EnterAuthorizePage(RIGHT_GUN_NUM);
  215. pSysInfo->SystemPage = _LCM_START_SCAN;
  216. } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
  217. //EnterDetailViewPage(RIGHT_GUN_NUM);
  218. showConfirmStopPage(RIGHT_GUN_NUM);
  219. } else if (pDcChargingInfo->SystemStatus == S_ALARM) {
  220. // 有進入充電時
  221. if (ShmDcCommonData->isIntoCharge[RIGHT_GUN_NUM]) {
  222. // 有插槍時顯示錯誤畫面
  223. if (pDcChargingInfo->ConnectorPlugIn) {
  224. pSysInfo->SystemPage = _LCM_ERROR;
  225. } else {
  226. // 未插槍時顯示結算畫面
  227. pSysInfo->SystemPage = _LCM_SUMMARY;
  228. //ReturnIDLE(RIGHT_GUN_NUM);
  229. }
  230. } else {
  231. // 未進入充電時顯示連線錯誤
  232. StopSystemTimeoutDet();
  233. StartSystemTimeoutDet(Timeout_LinkError);
  234. pSysInfo->SystemPage = _LCM_LINK_ERROR;
  235. }
  236. }
  237. break;
  238. case _LCM_START_SCAN:
  239. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM)
  240. ReturnIDLE(pSysInfo->CurGunSelected);
  241. break;
  242. case _LCM_START_AUTHORIZE_FAIL:
  243. if (pSysInfo->SystemPage == _LCM_START_AUTHORIZE_FAIL && pSysInfo->CurGunSelected == LEFT_GUN_NUM)
  244. break;
  245. ReturnAuthorize();
  246. break;
  247. case _LCM_WAIT_PLUGIN:
  248. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM)
  249. ReturnIDLE(RIGHT_GUN_NUM);
  250. break;
  251. case _LCM_LINK_ERROR:
  252. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM) {
  253. if (pDcChargingInfo->ConnectorPlugIn) {
  254. pSysInfo->SystemPage = _LCM_WAIT_PLUGOUT;
  255. StopSystemTimeoutDet();
  256. StartSystemTimeoutDet(Timeout_PlugOut);
  257. } else
  258. ReturnIDLE(pSysInfo->CurGunSelected);
  259. }
  260. break;
  261. /*
  262. case _LCM_DETAIL_VIEW:
  263. EnterAuthorizeStopPage();
  264. break;
  265. case _LCM_STOP_RFID_FAIL:
  266. EnterAuthorizeStopPage();
  267. break;
  268. */
  269. case _LCM_WAIT_PLUGOUT:
  270. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM) {
  271. if (pDcChargingInfo->ConnectorPlugIn && pDcChargingInfo->SystemStatus == S_ALARM) {
  272. pSysInfo->SystemPage = _LCM_VIEW;
  273. }
  274. }
  275. break;
  276. case _LCM_ERROR:
  277. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM)
  278. break;
  279. if (pDcChargingInfo->ConnectorPlugIn)
  280. pSysInfo->SystemPage = _LCM_WAIT_PLUGOUT;
  281. else
  282. pSysInfo->SystemPage = _LCM_SUMMARY;
  283. break;
  284. case _LCM_CONFIRM_STOP:
  285. if (pSysInfo->CurGunSelected == RIGHT_GUN_NUM) {
  286. StopChargingBtn(RIGHT_GUN_NUM);
  287. } else {
  288. EnterViewPage();
  289. }
  290. break;
  291. case _LCM_SUMMARY:
  292. if (pSysInfo->CurGunSelected == LEFT_GUN_NUM)
  293. break;
  294. log_info("Return View Page");
  295. ReturnIDLE(pSysInfo->CurGunSelected);
  296. break;
  297. }
  298. }
  299. void CheckPrimaryWarm(void)
  300. {
  301. uint8_t i = 0;
  302. uint8_t Rtn = 0;
  303. struct WARNING_CODE_INFO *pSysWarning = (struct WARNING_CODE_INFO *)GetShmSysWarningInfo();
  304. struct PrimaryMcuData *ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
  305. struct AlarmCodeData *pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
  306. DcCommonInfo *ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
  307. if (pSysWarning->WarningCount > 0) {
  308. Rtn = 0;
  309. for (i = 0; i < pSysWarning->WarningCount; i++) {
  310. if (memcmp(&pSysWarning->WarningCode[i][0], "042251", 6) == 0) {
  311. EmcOccureByString("042251");
  312. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = YES;
  313. Rtn = 1;
  314. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042252", 6) == 0) {
  315. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
  316. EmcOccureByString("042252");
  317. Rtn = 1;
  318. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
  319. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
  320. EmcOccureByString("042327");
  321. Rtn = 1;
  322. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
  323. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
  324. EmcOccureByString("042328");
  325. Rtn = 1;
  326. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
  327. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
  328. EmcOccureByString("042200");
  329. Rtn = 1;
  330. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042201", 6) == 0) {
  331. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = YES;
  332. EmcOccureByString("042201");
  333. Rtn = 1;
  334. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042202", 6) == 0) {
  335. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = YES;
  336. EmcOccureByString("042202");
  337. Rtn = 1;
  338. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042267", 6) == 0) {
  339. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = YES;
  340. EmcOccureByString("042267");
  341. Rtn = 1;
  342. } else if (memcmp(&pSysWarning->WarningCode[i][0], "012304", 6) == 0) {
  343. EmcOccureByString("012304");
  344. Rtn = 1;
  345. }
  346. }
  347. if (Rtn == 0) {
  348. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
  349. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
  350. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
  351. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
  352. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
  353. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
  354. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
  355. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
  356. ReleaseEmsOccureByString(0, "042251");
  357. ReleaseEmsOccureByString(0, "042252");
  358. ReleaseEmsOccureByString(0, "042200");
  359. ReleaseEmsOccureByString(0, "042327");
  360. ReleaseEmsOccureByString(0, "042328");
  361. ReleaseEmsOccureByString(0, "042201");
  362. ReleaseEmsOccureByString(0, "042202");
  363. ReleaseEmsOccureByString(0, "042267");
  364. ReleaseEmsOccureByString(0, "012304");
  365. }
  366. } else {
  367. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
  368. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
  369. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
  370. ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
  371. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
  372. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
  373. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
  374. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
  375. ReleaseEmsOccureByString(0, "042251");
  376. ReleaseEmsOccureByString(0, "042252");
  377. ReleaseEmsOccureByString(0, "042200");
  378. ReleaseEmsOccureByString(0, "042327");
  379. ReleaseEmsOccureByString(0, "042328");
  380. ReleaseEmsOccureByString(0, "042201");
  381. ReleaseEmsOccureByString(0, "042202");
  382. ReleaseEmsOccureByString(0, "042267");
  383. ReleaseEmsOccureByString(0, "012304");
  384. }
  385. if (ShmPrimaryMcuData->InputDet.bits.EmergencyButton == ABNORMAL) {
  386. pAlarmCode->AlarmEvents.bits.EmergencyStopTrip = YES;
  387. EmcOccureByString("012251");
  388. } else {
  389. ReleaseEmsOccureByString(0, "012251");
  390. }
  391. if (ShmPrimaryMcuData->InputDet.bits.AcMainBreakerDetec == ABNORMAL) {
  392. pAlarmCode->AlarmEvents.bits.MainPowerBreakerTrip = YES;
  393. EmcOccureByString("012238");
  394. } else {
  395. ReleaseEmsOccureByString(0, "012238");
  396. }
  397. if (ShmPrimaryMcuData->InputDet.bits.SpdDetec == ABNORMAL) {
  398. pAlarmCode->AlarmEvents.bits.SpdTrip = YES;
  399. } else {
  400. pAlarmCode->AlarmEvents.bits.SpdTrip = NO;
  401. }
  402. if (ShmPrimaryMcuData->InputDet.bits.DoorOpen == ABNORMAL) {
  403. pAlarmCode->AlarmEvents.bits.DoorOpen = YES;
  404. EmcOccureByString("012252");
  405. } else {
  406. ReleaseEmsOccureByString(0, "012252");
  407. }
  408. }
  409. void ChkPrimaryStatus(void)
  410. {
  411. static bool leftBtnPush = false;
  412. static bool rightBtnPush = false;
  413. pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
  414. struct PrimaryMcuData *ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
  415. struct ChargingInfoData *pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
  416. pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
  417. // Check Primary Board status
  418. CheckPrimaryWarm();
  419. if ((pDcChargingInfo->SystemStatus == S_IDLE || pDcChargingInfo->SystemStatus == S_RESERVATION)
  420. && pSysConfig->OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING) {
  421. log_info("Offline policy no charge");
  422. return;;
  423. }
  424. // Show Version
  425. if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
  426. ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS )
  427. pSysConfig->ShowInformation = YES;
  428. else
  429. pSysConfig->ShowInformation = NO;
  430. if (pSysConfig->ShowInformation)
  431. return;
  432. // Press Left Button
  433. if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS && !leftBtnPush ) {
  434. leftBtnPush = true;
  435. CheckLeftButton();
  436. log_info("left btn down...............................%d %d %d",
  437. pSysInfo->CurGunSelected,pDcChargingInfo->SystemStatus,pSysInfo->SystemPage);
  438. } else if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_RELEASE && leftBtnPush) {
  439. leftBtnPush = false;
  440. }
  441. // Press Right Button
  442. if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS && !rightBtnPush ) {
  443. rightBtnPush = true;
  444. CheckRightButton();
  445. log_info("right btn down...............................%d %d %d",
  446. pSysInfo->CurGunSelected,pDcChargingInfo->SystemStatus, pSysInfo->SystemPage);
  447. } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE && rightBtnPush) {
  448. rightBtnPush = false;
  449. }
  450. }