|
@@ -29,6 +29,7 @@ static struct PrimaryMcuData *ShmPrimaryMcuData;
|
|
|
static SelectGunInfo *ShmSelectGunInfo = NULL;
|
|
|
static struct ChargingInfoData *pDcChargingInfo = NULL;
|
|
|
static struct ChargingInfoData *pAcChargingInfo = NULL;
|
|
|
+static DcCommonInfo *ShmDcCommonData = NULL;
|
|
|
|
|
|
bool needReloadQr = true;
|
|
|
bool _saftydetect = false;
|
|
@@ -63,6 +64,7 @@ bool _page_reload = false;
|
|
|
|
|
|
// LCM - HW
|
|
|
uint8_t _everyPageRollChange = 0;
|
|
|
+short __logo = 0x0000;
|
|
|
short __conn_status = 0x0030;
|
|
|
short __ethernet_status = 0x0032;
|
|
|
short __3G4G_status = 0x0036;
|
|
@@ -73,7 +75,7 @@ short __wifi_status = 0x003C;
|
|
|
short __sel_gun_btn = 0x0040;
|
|
|
short __ret_home_btn = 0x0042;
|
|
|
short __stop_method_btn = 0x0044;
|
|
|
-
|
|
|
+short __lcm_version = 0x004A;
|
|
|
short __qr_code = 0x0250;
|
|
|
short __main_rfid = 0x0052;
|
|
|
short __main_qr = 0x0054;
|
|
@@ -139,7 +141,7 @@ short __remain_balance = 0x0280;
|
|
|
short __custStationIdL1 = 0x0450;
|
|
|
//short __custStationIdL2 = 0x0470;
|
|
|
short _emergency_map = 0x011C;
|
|
|
-
|
|
|
+short __logo_cmp = 0x014A;
|
|
|
// ICON ID
|
|
|
uint8_t _disappear = 0;
|
|
|
uint8_t _disconnect = 1;
|
|
@@ -419,20 +421,24 @@ void ReadMsgFromLcm(uint8_t *msg, uint8_t readLen)
|
|
|
switch (*(msg + 4)) {
|
|
|
case CMD_REGISTER: {
|
|
|
// 頁面
|
|
|
- strcpy((char *)pSysInfo->LcmHwRev, moduleName);
|
|
|
+ if(strcmp((char *)pSysInfo->LcmHwRev, "") != EQUAL)
|
|
|
+ strcpy((char *)pSysInfo->LcmHwRev, moduleName);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
} else if (*(msg + 3) == CMD_MULTI_READ) {
|
|
|
-// switch ((unsigned short) (*(msg + 4) << 8) + (unsigned short) *(msg + 5))
|
|
|
-// {
|
|
|
-// case BUTTON_GUN_INDEX:
|
|
|
-// {
|
|
|
-// // 當前選的槍號
|
|
|
-// _curGunIndex = (*(msg + 8));
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// }
|
|
|
+ short key = ((short)(*(msg + 4) << 8) + *(msg + 5));
|
|
|
+ if (key == __lcm_version)
|
|
|
+ {
|
|
|
+ if(strcmp((char *)pSysInfo->LcmHwRev, "") != EQUAL)
|
|
|
+ strcpy((char *)pSysInfo->LcmHwRev, moduleName);
|
|
|
+
|
|
|
+ ShmDcCommonData->LcmFwVersion = atoi((char *)(msg + 7));
|
|
|
+ //printf("msg = %d \n", ShmDcCommonData->LcmFwVersion);
|
|
|
+ // printf("msg = %x \n", *(msg + 7));
|
|
|
+ // printf("msg = %x \n", *(msg + 8));
|
|
|
+ // printf("msg = %x \n", *(msg + 9));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -808,7 +814,25 @@ void ChangeCurPage()
|
|
|
_everyPageRollChange = 0;
|
|
|
}
|
|
|
}
|
|
|
+void GetDeviceInfoStatus(short address, uint8_t len)
|
|
|
+{
|
|
|
+ uint8_t cmd[8];
|
|
|
+ memset(cmd, 0x00, sizeof(cmd));
|
|
|
+ uint8_t msg[11];
|
|
|
+ memset(msg, 0x00, sizeof(msg));
|
|
|
|
|
|
+ cmd[0] = CMD_TITLE_1;
|
|
|
+ cmd[1] = CMD_TITLE_2;
|
|
|
+ cmd[2] = 0x04;
|
|
|
+ cmd[3] = CMD_MULTI_READ;
|
|
|
+ cmd[4] = (address >> 8) & 0xff;
|
|
|
+ cmd[5] = (address >> 0) & 0xff;
|
|
|
+ cmd[6] = len;
|
|
|
+
|
|
|
+ WriteCmdToLcm(cmd, ARRAY_SIZE(cmd));
|
|
|
+ usleep(5000);
|
|
|
+ ReadMsgFromLcm(msg, ARRAY_SIZE(msg));
|
|
|
+}
|
|
|
//================================================
|
|
|
// Main process
|
|
|
//================================================
|
|
@@ -2372,6 +2396,14 @@ void DefaultIconStatus()
|
|
|
} else {
|
|
|
ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
|
|
|
}
|
|
|
+ if (ShmDcCommonData->LcmFwVersion >= 2)
|
|
|
+ {
|
|
|
+ ChangeDisplay2Value(__logo, _logo);
|
|
|
+ ChangeDisplay2Value(__logo_cmp, _logo_cmp);
|
|
|
+ } else {
|
|
|
+ ChangeDisplay2Value(__logo, _disappear);
|
|
|
+ ChangeDisplay2Value(__logo_cmp, _disappear);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
int main(void)
|
|
@@ -2401,7 +2433,7 @@ int main(void)
|
|
|
ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
|
|
|
ShmSelectGunInfo = (SelectGunInfo *)GetShmSelectGunInfo();
|
|
|
struct StatusCodeData *ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();;
|
|
|
-
|
|
|
+ ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
|
|
|
|
|
|
_port = CreateCommunicationLcmPort();
|
|
|
uint8_t changeWarningPriority = 0;
|
|
@@ -2410,7 +2442,6 @@ int main(void)
|
|
|
_totalCount = pSysConfig->TotalConnectorCount;
|
|
|
acgunCount = pSysConfig->AcConnectorCount;
|
|
|
//Initialization();
|
|
|
-
|
|
|
//printf("_LCM_COMPLETE ");
|
|
|
//ChangeToOtherPage(_LCM_COMPLETE);
|
|
|
//return 0;
|
|
@@ -2419,22 +2450,26 @@ int main(void)
|
|
|
ChangeDisplay2Value(__gun_type_index + (i * 2), _disappear);
|
|
|
}
|
|
|
|
|
|
+ uint8_t _verShowCount = 3;
|
|
|
DefaultIconStatus(); //DS60-120 add
|
|
|
|
|
|
while (_port != -1) {
|
|
|
if (strcmp((char *)pSysInfo->LcmHwRev, moduleName) != 0x00) {
|
|
|
+ GetDeviceInfoStatus(__lcm_version, 3);
|
|
|
GetCurrentPage();
|
|
|
sleep(1);
|
|
|
#ifndef DD360ComBox
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.LcmModuleCommFail = true;
|
|
|
#endif
|
|
|
-
|
|
|
+ if (_verShowCount > 0) {
|
|
|
+ log_info("LCM Version = V.%03d \n", ShmDcCommonData->LcmFwVersion);
|
|
|
+ _verShowCount--;
|
|
|
+ }
|
|
|
} else {
|
|
|
//DemoFunction();
|
|
|
#ifndef DD360ComBox
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.LcmModuleCommFail = false;
|
|
|
#endif
|
|
|
-
|
|
|
// Warning 處理
|
|
|
if (curWarningCount != pSysWarning->WarningCount) {
|
|
|
changeWarningPriority = 0;
|