Primary.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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. //------------------------------------------------------------------------------
  12. //------------------------------------------------------------------------------
  13. static uint8_t checkCabinetEthConnectState(LedConfig *ledConfig)
  14. {
  15. uint8_t ret = NO;
  16. LedConfig *pLedConfig = (LedConfig *)ledConfig;
  17. struct AlarmCodeData *pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
  18. if (pAlarmCode->AlarmEvents.bits.DisconnectedFromDo == YES) {
  19. ret = YES;
  20. if (pLedConfig->RedLED == YES ||
  21. pLedConfig->YellowLED == YES ||
  22. pLedConfig->GreenLED == YES) {
  23. pLedConfig->RedLED = NO;
  24. pLedConfig->YellowLED = NO;
  25. pLedConfig->GreenLED = NO;
  26. } else {
  27. pLedConfig->RedLED = YES;
  28. pLedConfig->YellowLED = YES;
  29. pLedConfig->GreenLED = YES;
  30. }
  31. }
  32. return ret;
  33. }
  34. void PrimaryLedIndicatorCtrlFork(void)
  35. {
  36. #if !defined DD360ComBox
  37. return;
  38. #endif //!defined DD360ComBox
  39. pid_t pid = fork();
  40. if (pid == 0) {
  41. uint8_t gunIndex = 0;
  42. int isContinue = 1;
  43. struct SysConfigData *pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
  44. struct SysInfoData *pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
  45. struct WARNING_CODE_INFO *pSysWarning = (struct WARNING_CODE_INFO *)GetShmSysWarningInfo();
  46. struct PrimaryMcuData *ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
  47. struct ChargingInfoData *pDcChargingInfo = NULL;
  48. LedConfig *pLedConfig = (LedConfig *)&ShmPrimaryMcuData->OutputDrv.OutputDrvValue[0];
  49. while (isContinue) {
  50. for (gunIndex = 0; gunIndex < pSysConfig->TotalConnectorCount; gunIndex++) {
  51. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(gunIndex);
  52. if (pSysWarning->Level == WARN_LV_ER) {
  53. if (checkCabinetEthConnectState(pLedConfig) == YES) {
  54. usleep(500000);
  55. continue;
  56. }
  57. pLedConfig->YellowLED = NO;
  58. pLedConfig->GreenLED = NO;
  59. pLedConfig->RedLED = YES;
  60. usleep(500000);
  61. continue;
  62. }
  63. //printf("led indicator status = %d\r\n", chargingInfo[gunIndex]->SystemStatus);
  64. //printf("level = %d\r\n", pSysWarning->Level);
  65. switch (pDcChargingInfo->SystemStatus) {
  66. case S_BOOTING:
  67. if (pSysInfo->SelfTestSeq == _STEST_COMPLETE) {
  68. //Module_DoComm tcp disconnect
  69. if (pLedConfig->RedLED == YES ||
  70. pLedConfig->YellowLED == YES ||
  71. pLedConfig->GreenLED == YES) {
  72. pLedConfig->RedLED = NO;
  73. pLedConfig->YellowLED = NO;
  74. pLedConfig->GreenLED = NO;
  75. } else {
  76. pLedConfig->RedLED = YES;
  77. pLedConfig->YellowLED = YES;
  78. pLedConfig->GreenLED = YES;
  79. }
  80. break;
  81. }
  82. pLedConfig->RedLED = YES;
  83. pLedConfig->YellowLED = YES;
  84. pLedConfig->GreenLED = YES;
  85. break;
  86. case S_IDLE:
  87. //Module_DoComm connected and system idle
  88. pLedConfig->RedLED = NO;
  89. pLedConfig->YellowLED = NO;
  90. pLedConfig->GreenLED = YES;
  91. break;
  92. case S_RESERVATION:
  93. case S_AUTHORIZING:
  94. case S_REASSIGN_CHECK:
  95. case S_REASSIGN:
  96. case S_PREPARNING:
  97. case S_PREPARING_FOR_EV:
  98. case S_PREPARING_FOR_EVSE:
  99. case S_CCS_PRECHARGE_ST0:
  100. case S_CCS_PRECHARGE_ST1:
  101. //precharging status
  102. if (pLedConfig->GreenLED == YES) {
  103. pLedConfig->GreenLED = NO;
  104. } else {
  105. pLedConfig->GreenLED = YES;
  106. }
  107. break;
  108. case S_CHARGING:
  109. pLedConfig->RedLED = NO;
  110. if (pLedConfig->YellowLED == YES) {
  111. pLedConfig->YellowLED = NO;
  112. } else {
  113. pLedConfig->YellowLED = YES;
  114. }
  115. pLedConfig->GreenLED = NO;
  116. break;
  117. case S_ALARM:
  118. pLedConfig->YellowLED = NO;
  119. pLedConfig->GreenLED = NO;
  120. if (checkCabinetEthConnectState(pLedConfig) == YES) {
  121. break;
  122. }
  123. pLedConfig->RedLED = YES;
  124. break;
  125. case S_TERMINATING:
  126. case S_COMPLETE:
  127. //if (pSysWarning->Level == WARN_LV_ER) {
  128. // pLedConfig->YellowLED = NO;
  129. // pLedConfig->GreenLED = NO;
  130. // if (checkCabinetEthConnectState(pLedConfig) == YES) {
  131. // break;
  132. // }
  133. // pLedConfig->RedLED = YES;
  134. //} else {
  135. pLedConfig->RedLED = NO;
  136. pLedConfig->YellowLED = YES;
  137. pLedConfig->GreenLED = NO;
  138. //}
  139. break;
  140. case S_MAINTAIN:
  141. case S_FAULT:
  142. pLedConfig->YellowLED = NO;
  143. pLedConfig->GreenLED = NO;
  144. pLedConfig->RedLED = YES;
  145. //if (pSysWarning->Level == WARN_LV_ER) {
  146. // if (checkCabinetEthConnectState(pLedConfig) == YES) {
  147. // break;
  148. // }
  149. // pLedConfig->RedLED = YES;
  150. //}
  151. break;
  152. case S_BOOKING:
  153. case S_DEBUG:
  154. case S_UPDATE:
  155. case S_NONE:
  156. break;
  157. }//switch
  158. }//for
  159. usleep(500000);
  160. }//while
  161. }//fork
  162. }
  163. //------------------------------------------------------------------------------
  164. static void checkChargingInfoByDC(uint8_t systemStatus)
  165. {
  166. struct SysConfigData *pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
  167. struct SysInfoData *pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
  168. switch (systemStatus) {
  169. case S_IDLE:
  170. if (isDetectPlugin()) {
  171. _DetectPlugInTimeout();
  172. StopSystemTimeoutDet();
  173. destroySelGun(pSysInfo->CurGunSelected);
  174. } else {
  175. #if !defined DD360Audi
  176. break;
  177. #endif //!defined DD360Audi
  178. if (getConfirmSelectedGun(pSysInfo->CurGunSelected) == PASS) {
  179. //printf("destroy gun = %d\r\n", pSysInfo->CurGunSelected);
  180. destroySelGun(pSysInfo->CurGunSelected);
  181. } else {
  182. confirmSelGun(pSysInfo->CurGunSelected);
  183. log_info("confirm select gun ............................... %d \n",
  184. pSysInfo->CurGunSelected);
  185. }
  186. }
  187. break;
  188. case S_REASSIGN_CHECK:
  189. case S_REASSIGN:
  190. case S_PREPARNING:
  191. case S_PREPARING_FOR_EV:
  192. case S_PREPARING_FOR_EVSE:
  193. case S_CCS_PRECHARGE_ST0:
  194. case S_CCS_PRECHARGE_ST1:
  195. // 取消充電
  196. if (pSysInfo->CurGunSelectedByAc != NO_DEFINE) {
  197. AcChargingTerminalProcess();
  198. } else {
  199. ChargingTerminalProcess(pSysInfo->CurGunSelected);
  200. }
  201. break;
  202. case S_CHARGING:
  203. if (pSysConfig->StopChargingByButton == YES ||
  204. pSysConfig->AuthorisationMode == AUTH_MODE_DISABLE) {
  205. // 停止充電
  206. ChargingTerminalProcess(pSysInfo->CurGunSelected);
  207. }
  208. break;
  209. case S_COMPLETE:
  210. break;
  211. }
  212. }
  213. static void checkChargingInfoByAC(void)
  214. {
  215. struct ChargingInfoData *pAcChargingInfo = NULL;
  216. struct SysConfigData *pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
  217. struct SysInfoData *pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
  218. if (pSysInfo->CurGunSelectedByAc == NO_DEFINE) {
  219. return;
  220. }
  221. pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
  222. switch (pAcChargingInfo->SystemStatus) {
  223. case S_IDLE:
  224. if (isDetectPlugin()) {
  225. _DetectPlugInTimeout();
  226. StopSystemTimeoutDet();
  227. }
  228. break;
  229. case S_REASSIGN_CHECK:
  230. case S_REASSIGN:
  231. case S_PREPARNING:
  232. case S_PREPARING_FOR_EV:
  233. case S_PREPARING_FOR_EVSE:
  234. case S_CCS_PRECHARGE_ST0:
  235. case S_CCS_PRECHARGE_ST1:
  236. // 取消充電
  237. AcChargingTerminalProcess();
  238. break;
  239. case S_CHARGING:
  240. if (pSysConfig->AuthorisationMode == AUTH_MODE_DISABLE) {
  241. // 停止充電
  242. AcChargingTerminalProcess();
  243. }
  244. break;
  245. case S_COMPLETE:
  246. break;
  247. }
  248. }
  249. void ChkPrimaryStatus(void)
  250. {
  251. static bool leftBtnPush = false;
  252. static bool rightBtnPush = false;
  253. uint8_t i = 0;
  254. uint8_t Rtn = 0;
  255. struct SysConfigData *pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
  256. struct SysInfoData *pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
  257. struct WARNING_CODE_INFO *pSysWarning = (struct WARNING_CODE_INFO *)GetShmSysWarningInfo();
  258. struct PrimaryMcuData *ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
  259. struct AlarmCodeData *pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
  260. struct ChargingInfoData *pDcChargingInfo = NULL;
  261. DcCommonInfo *ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
  262. if (pSysWarning->WarningCount > 0) {
  263. Rtn = 0;
  264. for (i = 0; i < pSysWarning->WarningCount; i++) {
  265. if (memcmp(&pSysWarning->WarningCode[i][0], "042251", 6) == 0) {
  266. EmcOccureByString("042251");
  267. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = YES;
  268. Rtn = 1;
  269. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042252", 6) == 0) {
  270. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
  271. EmcOccureByString("042252");
  272. Rtn = 1;
  273. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
  274. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
  275. EmcOccureByString("042200");
  276. Rtn = 1;
  277. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042201", 6) == 0) {
  278. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = YES;
  279. EmcOccureByString("042201");
  280. Rtn = 1;
  281. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042202", 6) == 0) {
  282. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = YES;
  283. EmcOccureByString("042202");
  284. Rtn = 1;
  285. } else if (memcmp(&pSysWarning->WarningCode[i][0], "042267", 6) == 0) {
  286. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = YES;
  287. EmcOccureByString("042267");
  288. Rtn = 1;
  289. } else if (memcmp(&pSysWarning->WarningCode[i][0], "012304", 6) == 0) {
  290. EmcOccureByString("012304");
  291. Rtn = 1;
  292. }
  293. }
  294. if (Rtn == 0) {
  295. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
  296. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
  297. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
  298. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
  299. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
  300. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
  301. ReleaseEmsOccureByString(0, "042251");
  302. ReleaseEmsOccureByString(0, "042252");
  303. ReleaseEmsOccureByString(0, "042200");
  304. ReleaseEmsOccureByString(0, "042201");
  305. ReleaseEmsOccureByString(0, "042202");
  306. ReleaseEmsOccureByString(0, "042267");
  307. ReleaseEmsOccureByString(0, "012304");
  308. }
  309. } else {
  310. ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
  311. ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
  312. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
  313. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
  314. ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
  315. ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
  316. ReleaseEmsOccureByString(0, "042251");
  317. ReleaseEmsOccureByString(0, "042252");
  318. ReleaseEmsOccureByString(0, "042200");
  319. ReleaseEmsOccureByString(0, "042201");
  320. ReleaseEmsOccureByString(0, "042202");
  321. ReleaseEmsOccureByString(0, "042267");
  322. ReleaseEmsOccureByString(0, "012304");
  323. }
  324. if (ShmPrimaryMcuData->InputDet.bits.EmergencyButton == ABNORMAL) {
  325. pAlarmCode->AlarmEvents.bits.EmergencyStopTrip = YES;
  326. EmcOccureByString("012251");
  327. } else {
  328. ReleaseEmsOccureByString(0, "012251");
  329. }
  330. if (ShmPrimaryMcuData->InputDet.bits.AcMainBreakerDetec == ABNORMAL) {
  331. pAlarmCode->AlarmEvents.bits.MainPowerBreakerTrip = YES;
  332. EmcOccureByString("012238");
  333. } else {
  334. ReleaseEmsOccureByString(0, "012238");
  335. }
  336. if (ShmPrimaryMcuData->InputDet.bits.SpdDetec == ABNORMAL) {
  337. pAlarmCode->AlarmEvents.bits.SpdTrip = YES;
  338. } else {
  339. pAlarmCode->AlarmEvents.bits.SpdTrip = NO;
  340. }
  341. if (ShmPrimaryMcuData->InputDet.bits.DoorOpen == ABNORMAL) {
  342. pAlarmCode->AlarmEvents.bits.DoorOpen = YES;
  343. EmcOccureByString("012252");
  344. } else {
  345. ReleaseEmsOccureByString(0, "012252");
  346. }
  347. //DS60-120 add
  348. //if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
  349. // ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS) {
  350. // pSysConfig->ShowInformation = YES;
  351. //} else {
  352. // pSysConfig->ShowInformation = NO;
  353. //}
  354. if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
  355. !leftBtnPush
  356. #if defined DD360Audi
  357. &&
  358. pSysInfo->SystemPage != _LCM_AUTHORIZING &&
  359. pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
  360. pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
  361. #endif //defined DD360Audi
  362. ) {
  363. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
  364. if (!leftBtnPush) {
  365. leftBtnPush = true;
  366. log_info("left btn down...............................%x\n",
  367. pDcChargingInfo->SystemStatus);
  368. checkChargingInfoByAC();
  369. checkChargingInfoByDC(pDcChargingInfo->SystemStatus);
  370. #if 0
  371. if (pSysInfo->CurGunSelectedByAc != NO_DEFINE) {
  372. pAcChargingInfo = (struct ChargingInfoData *)GetAcChargingInfoData(0);
  373. switch (pAcChargingInfo->SystemStatus) {
  374. case S_IDLE:
  375. if (isDetectPlugin()) {
  376. _DetectPlugInTimeout();
  377. StopSystemTimeoutDet();
  378. }
  379. break;
  380. case S_REASSIGN_CHECK:
  381. case S_REASSIGN:
  382. case S_PREPARNING:
  383. case S_PREPARING_FOR_EV:
  384. case S_PREPARING_FOR_EVSE:
  385. case S_CCS_PRECHARGE_ST0:
  386. case S_CCS_PRECHARGE_ST1:
  387. // 取消充電
  388. AcChargingTerminalProcess();
  389. break;
  390. case S_CHARGING:
  391. if (pSysConfig->AuthorisationMode == AUTH_MODE_DISABLE) {
  392. // 停止充電
  393. AcChargingTerminalProcess();
  394. }
  395. break;
  396. case S_COMPLETE:
  397. break;
  398. }
  399. }
  400. switch (pDcChargingInfo->SystemStatus) {
  401. case S_IDLE:
  402. if (isDetectPlugin()) {
  403. _DetectPlugInTimeout();
  404. StopSystemTimeoutDet();
  405. destroySelGun(pSysInfo->CurGunSelected);
  406. } else {
  407. #if defined DD360Audi
  408. if (getConfirmSelectedGun(pSysInfo->CurGunSelected) == PASS) {
  409. //printf("destroy gun = %d\r\n", pSysInfo->CurGunSelected);
  410. destroySelGun(pSysInfo->CurGunSelected);
  411. } else {
  412. confirmSelGun(pSysInfo->CurGunSelected);
  413. log_info("confirm select gun ............................... %d \n",
  414. pSysInfo->CurGunSelected);
  415. }
  416. #endif //defined DD360Audi
  417. }
  418. break;
  419. case S_REASSIGN_CHECK:
  420. case S_REASSIGN:
  421. case S_PREPARNING:
  422. case S_PREPARING_FOR_EV:
  423. case S_PREPARING_FOR_EVSE:
  424. case S_CCS_PRECHARGE_ST0:
  425. case S_CCS_PRECHARGE_ST1:
  426. // 取消充電
  427. if (pSysInfo->CurGunSelectedByAc != NO_DEFINE) {
  428. AcChargingTerminalProcess();
  429. } else {
  430. ChargingTerminalProcess(pSysInfo->CurGunSelected);
  431. }
  432. break;
  433. case S_CHARGING:
  434. if (pSysConfig->StopChargingByButton == YES ||
  435. pSysConfig->AuthorisationMode == AUTH_MODE_DISABLE) {
  436. // 停止充電
  437. ChargingTerminalProcess(pSysInfo->CurGunSelected);
  438. }
  439. break;
  440. case S_COMPLETE:
  441. // 回 IDLE
  442. //log_info("right btn down.................S_COMPLETE \n");
  443. //pDcChargingInfo->SystemStatus = S_IDLE;
  444. break;
  445. }
  446. #endif //0
  447. }
  448. } else if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_RELEASE) {
  449. if (leftBtnPush) {
  450. leftBtnPush = false;
  451. //log_info("left btn up............................... \n");
  452. }
  453. }
  454. if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
  455. !rightBtnPush
  456. #if defined DD360Audi
  457. &&
  458. pSysInfo->SystemPage != _LCM_IDLE &&
  459. pSysInfo->SystemPage != _LCM_AUTHORIZING &&
  460. pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
  461. pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
  462. pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
  463. #endif //defined DD360Audi
  464. ) {
  465. if (!rightBtnPush) {
  466. rightBtnPush = true;
  467. //log_info("right btn down............................... %d \n", pSysInfo->CurGunSelected);
  468. if (pSysInfo->CurGunSelected + 1 < pSysConfig->TotalConnectorCount &&
  469. pSysInfo->IsAlternatvieConf == NO) {
  470. pSysInfo->CurGunSelected++;
  471. ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
  472. } else if (pSysConfig->AcConnectorCount > 0 &&
  473. pSysInfo->CurGunSelectedByAc == NO_DEFINE) {
  474. pSysInfo->CurGunSelectedByAc = DEFAULT_AC_INDEX;
  475. } else if (pSysInfo->IsAlternatvieConf == YES) {
  476. for (uint8_t _index = 0; _index < pSysConfig->TotalConnectorCount; _index++) {
  477. pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(_index);
  478. if (pDcChargingInfo->SystemStatus != S_BOOTING &&
  479. pDcChargingInfo->SystemStatus != S_IDLE &&
  480. pDcChargingInfo->SystemStatus != S_RESERVATION) {
  481. pSysInfo->CurGunSelected = _index;
  482. ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
  483. return;
  484. }
  485. }
  486. pSysInfo->CurGunSelected = 0;
  487. ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
  488. } else {
  489. pSysInfo->CurGunSelected = 0;
  490. ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
  491. }
  492. }
  493. log_info("current select gun ............................... %d \n",
  494. pSysInfo->CurGunSelected);
  495. } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
  496. if (rightBtnPush) {
  497. rightBtnPush = false;
  498. //log_info("right btn up............................... \n");
  499. }
  500. }
  501. }