|
@@ -39,20 +39,24 @@
|
|
|
#define YES 1
|
|
|
#define NO 0
|
|
|
|
|
|
-#define GUN_COUNT CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY
|
|
|
-
|
|
|
struct SysConfigAndInfo *ShmSysConfigAndInfo;
|
|
|
struct StatusCodeData *ShmStatusCodeData;
|
|
|
struct FanModuleData *ShmFanModuleData;
|
|
|
struct CHAdeMOData *ShmCHAdeMOData;
|
|
|
+struct GBTData *ShmGBTData;
|
|
|
struct CcsData *ShmCcsData;
|
|
|
|
|
|
byte gun_count;
|
|
|
int chargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
|
|
|
+float _pow_1 = 0;
|
|
|
+float _cur_1 = 0;
|
|
|
+float _pow_2 = 0;
|
|
|
+float _cur_2 = 0;
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-float maxChargingVol[2] = { 10000, 9500 };
|
|
|
+
|
|
|
+float maxChargingVol[2] = { 9500, 9500 };
|
|
|
|
|
|
float maxChargingCur[2] = { 0, 0 };
|
|
|
float maxChargingPow = 0;
|
|
@@ -145,7 +149,7 @@ void PRINTF_FUNC(char *string, ...)
|
|
|
vsnprintf(buffer, sizeof(buffer), string, args);
|
|
|
va_end(args);
|
|
|
|
|
|
- if (DEBUG)
|
|
|
+ if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
|
|
|
printf("%s \n", buffer);
|
|
|
else
|
|
|
DEBUG_INFO("%s \n", buffer);
|
|
@@ -252,6 +256,25 @@ int InitShareMemory()
|
|
|
else
|
|
|
{}
|
|
|
}
|
|
|
+ if(GB_QUANTITY > 0)
|
|
|
+ {
|
|
|
+ if ((MeterSMId = shmget(ShmGBTCommKey, sizeof(struct GBTData), IPC_CREAT | 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ DEBUG_ERROR("[shmget ShmGBTData NG \n");
|
|
|
+ #endif
|
|
|
+ return FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmGBTData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ DEBUG_ERROR("shmat ShmGBTData NG \n");
|
|
|
+ #endif
|
|
|
+ return FAIL;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {}
|
|
|
+ }
|
|
|
|
|
|
if(CCS_QUANTITY > 0)
|
|
|
{
|
|
@@ -369,7 +392,7 @@ void AddrAssignment(byte *data)
|
|
|
|
|
|
if (gun_count == 1)
|
|
|
index = 0x01;
|
|
|
- if (CheckUniqNumber(index))
|
|
|
+
|
|
|
{
|
|
|
PRINTF_FUNC("EV board id = %x \n", index);
|
|
|
|
|
@@ -422,6 +445,71 @@ void ClearAbnormalStatus_Chademo(byte gun_index)
|
|
|
ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = 0x00;
|
|
|
}
|
|
|
|
|
|
+void ClearAbnormalStatus_GB(byte gun_index)
|
|
|
+{
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = 0x00;
|
|
|
+ ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = 0x00;
|
|
|
+}
|
|
|
+
|
|
|
void ClearAbnormalStatus_CCS(byte gun_index)
|
|
|
{
|
|
|
ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = 0x00;
|
|
@@ -737,6 +825,68 @@ void AbnormalStopAnalysis(byte gun_index, byte *errCode)
|
|
|
if (strcmp(string, "023887") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = 0x01;
|
|
|
if (strcmp(string, "023888") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = 0x01;
|
|
|
if (strcmp(string, "023889") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = 0x01;
|
|
|
+
|
|
|
+ if (strcmp(string, "023900") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = 0x01;
|
|
|
+ if (strcmp(string, "023901") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = 0x01;
|
|
|
+ if (strcmp(string, "023902") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = 0x01;
|
|
|
+ if (strcmp(string, "023903") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023904") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023905") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = 0x01;
|
|
|
+ if (strcmp(string, "023906") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = 0x01;
|
|
|
+ if (strcmp(string, "023907") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = 0x01;
|
|
|
+ if (strcmp(string, "023908") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023909") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = 0x01;
|
|
|
+ if (strcmp(string, "023910") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = 0x01;
|
|
|
+ if (strcmp(string, "023911") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = 0x01;
|
|
|
+ if (strcmp(string, "023912") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = 0x01;
|
|
|
+ if (strcmp(string, "023913") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = 0x01;
|
|
|
+ if (strcmp(string, "023914") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = 0x01;
|
|
|
+ if (strcmp(string, "023915") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = 0x01;
|
|
|
+ if (strcmp(string, "023916") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = 0x01;
|
|
|
+ if (strcmp(string, "023917") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = 0x01;
|
|
|
+ if (strcmp(string, "023918") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = 0x01;
|
|
|
+ if (strcmp(string, "023919") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = 0x01;
|
|
|
+ if (strcmp(string, "023930") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023931") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023932") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023933") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023934") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023935") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023936") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023937") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023938") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023939") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023940") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023941") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023942") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023943") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023944") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023945") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023946") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023947") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = 0x01;
|
|
|
+ if (strcmp(string, "023950") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = 0x01;
|
|
|
+ if (strcmp(string, "023951") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = 0x01;
|
|
|
+ if (strcmp(string, "023952") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = 0x01;
|
|
|
+ if (strcmp(string, "023953") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = 0x01;
|
|
|
+ if (strcmp(string, "023954") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = 0x01;
|
|
|
+ if (strcmp(string, "023955") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = 0x01;
|
|
|
+ if (strcmp(string, "023956") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = 0x01;
|
|
|
+ if (strcmp(string, "023957") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = 0x01;
|
|
|
+ if (strcmp(string, "023958") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = 0x01;
|
|
|
+ if (strcmp(string, "023959") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = 0x01;
|
|
|
+ if (strcmp(string, "023960") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = 0x01;
|
|
|
+ if (strcmp(string, "023961") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = 0x01;
|
|
|
+ if (strcmp(string, "023962") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = 0x01;
|
|
|
+ if (strcmp(string, "023963") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = 0x01;
|
|
|
+ if (strcmp(string, "023964") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = 0x01;
|
|
|
+ if (strcmp(string, "023970") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = 0x01;
|
|
|
+ if (strcmp(string, "023971") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = 0x01;
|
|
|
+ if (strcmp(string, "023972") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = 0x01;
|
|
|
+ if (strcmp(string, "023973") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = 0x01;
|
|
|
+ if (strcmp(string, "023974") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = 0x01;
|
|
|
+ if (strcmp(string, "023975") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = 0x01;
|
|
|
+ if (strcmp(string, "023976") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = 0x01;
|
|
|
+ if (strcmp(string, "023977") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = 0x01;
|
|
|
}
|
|
|
|
|
|
void CANReceiver()
|
|
@@ -755,7 +905,7 @@ void CANReceiver()
|
|
|
struct timeval _cmd_ack_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
|
|
|
bool isPass = false;
|
|
|
- gun_count = GUN_COUNT;
|
|
|
+ gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
|
|
|
|
|
|
while(!isPass)
|
|
|
{
|
|
@@ -842,6 +992,12 @@ void CANReceiver()
|
|
|
ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
PRINTF_FUNC("chademo ver. : %s\n", ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version);
|
|
|
}
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ memcpy(ShmGBTData->evse[_chargingData[targetGun]->type_index].version, frame.data, ARRAY_SIZE(frame.data));
|
|
|
+ ShmGBTData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
+ PRINTF_FUNC("gbt ver. : %s\n", ShmGBTData->evse[_chargingData[targetGun]->type_index].version);
|
|
|
+ }
|
|
|
else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
if (ShmCcsData->CommProtocol == 0x01)
|
|
@@ -877,6 +1033,18 @@ void CANReceiver()
|
|
|
ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = _chargingData[targetGun]->EvBatterytargetVoltage;
|
|
|
ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = _chargingData[targetGun]->EvBatterytargetCurrent;
|
|
|
}
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ if (ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
|
|
|
+ {
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = _chargingData[targetGun]->EvBatterytargetVoltage;
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = _chargingData[targetGun]->EvBatterytargetCurrent;
|
|
|
+ }
|
|
|
else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
if(ShmCcsData->CommProtocol == 0x01)
|
|
@@ -907,6 +1075,11 @@ void CANReceiver()
|
|
|
|
|
|
|
|
|
}
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
|
|
|
+ ShmGBTData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
|
|
|
+ }
|
|
|
else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
|
|
@@ -923,6 +1096,14 @@ void CANReceiver()
|
|
|
_chargingData[targetGun]->PilotVoltage = (float)(-120 + frame.data[3]) / 10;
|
|
|
ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
|
|
|
}
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ _chargingData[targetGun]->GunLocked = frame.data[0];
|
|
|
+ ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
|
|
|
+ ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
|
|
|
+ _chargingData[targetGun]->PilotVoltage = (float)(-120 + frame.data[3]) / 10;
|
|
|
+ ShmGBTData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
|
|
|
+ }
|
|
|
else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
if (ShmCcsData->CommProtocol == 0x01)
|
|
@@ -1025,7 +1206,16 @@ void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct
|
|
|
GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
|
|
|
GetMaxPowerMethod(&pow2);
|
|
|
|
|
|
- PRINTF_FUNC("To EV Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n", pow1, cur1, pow2, cur2);
|
|
|
+ if (_pow_1 != pow1 ||
|
|
|
+ _cur_1 != cur1 ||
|
|
|
+ _pow_2 != pow2 ||
|
|
|
+ _cur_2 != cur2)
|
|
|
+ {
|
|
|
+ PRINTF_FUNC("To EV Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n",
|
|
|
+ pow1, cur1, pow2, cur2);
|
|
|
+ _pow_1 = pow1; _cur_1 = cur1; _pow_2 = pow2; _cur_2 = cur2;
|
|
|
+ }
|
|
|
+
|
|
|
SetPresentOutputCapacity(pow1, cur1, pow2, cur2);
|
|
|
}
|
|
|
|
|
@@ -1125,6 +1315,20 @@ byte GetStopChargingReasonByEvse(byte gunIndex, byte *reason)
|
|
|
result = YES;
|
|
|
}
|
|
|
}
|
|
|
+ else if (_chargingData[gunIndex]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ if (ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayDrivingFault == YES)
|
|
|
+ {
|
|
|
+
|
|
|
+ *(reason + 5) = 0;
|
|
|
+ *(reason + 4) = 1;
|
|
|
+ *(reason + 3) = 2;
|
|
|
+ *(reason + 2) = 2;
|
|
|
+ *(reason + 1) = 9;
|
|
|
+ *(reason + 0) = 0;
|
|
|
+ result = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
else if (_chargingData[gunIndex]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
if (ShmStatusCodeData->FaultCode.FaultEvents.bits.CcsOutputRelayDrivingFault == YES)
|
|
@@ -1169,7 +1373,7 @@ int main(int argc, char *argv[])
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- gun_count = GUN_COUNT;
|
|
|
+ gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
|
|
|
Initialization();
|
|
|
CanFd = InitCanBus();
|
|
|
CANReceiver();
|
|
@@ -1188,7 +1392,12 @@ int main(int argc, char *argv[])
|
|
|
{
|
|
|
SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
- GetHardwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
+ }
|
|
|
+ else if (_chargingData[_index]->Type == _Type_GB &&
|
|
|
+ ShmGBTData->evse[_chargingData[_index]->type_index].SelfTest_Comp != PASS)
|
|
|
+ {
|
|
|
+ SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
+ GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
}
|
|
|
else if (_chargingData[_index]->Type == _Type_CCS_2)
|
|
|
{
|
|
@@ -1197,13 +1406,16 @@ int main(int argc, char *argv[])
|
|
|
{
|
|
|
SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
- GetHardwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- GetMiscellaneousInfo(_index, _chargingData[_index]->Evboard_id);
|
|
|
+ GetMiscellaneousInfo(_index,
|
|
|
+ _chargingData[_index]->RelayK1K2Status,
|
|
|
+ _chargingData[_index]->PresentChargedEnergy,
|
|
|
+ (_chargingData[_index]->PresentChargingVoltage * 10),
|
|
|
+ _chargingData[_index]->Evboard_id);
|
|
|
}
|
|
|
|
|
|
switch (_chargingData[_index]->SystemStatus)
|
|
@@ -1220,6 +1432,10 @@ int main(int argc, char *argv[])
|
|
|
{
|
|
|
ClearAbnormalStatus_Chademo(_index);
|
|
|
}
|
|
|
+ else if (_chargingData[_index]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ ClearAbnormalStatus_GB(_index);
|
|
|
+ }
|
|
|
else if (_chargingData[_index]->Type == _Type_CCS_2)
|
|
|
{
|
|
|
ClearAbnormalStatus_CCS(_index);
|
|
@@ -1266,7 +1482,8 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
|
|
|
|
|
|
- PRINTF_FUNC("To EV_%d Max_Vol = %f, Cap_Cur = %f, Cap_Pow = %f \n", _index, maxVol, maxCur, _chargingData[_index]->AvailableChargingPower);
|
|
|
+ PRINTF_FUNC("To EV_%d Max_Vol = %f, Cap_Cur = %f, Cap_Pow = %f \n",
|
|
|
+ _index, maxVol, maxCur, _chargingData[_index]->AvailableChargingPower);
|
|
|
SetChargingPermission(_index, START,
|
|
|
_chargingData[_index]->AvailableChargingPower,
|
|
|
maxCur,
|
|
@@ -1304,6 +1521,10 @@ int main(int argc, char *argv[])
|
|
|
if (priorityLow == 1)
|
|
|
{
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if(_chargingData[_index]->GroundFaultStatus != GFD_WAIT)
|
|
|
{
|
|
|
SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
|
|
@@ -1320,7 +1541,7 @@ int main(int argc, char *argv[])
|
|
|
case S_CHARGING:
|
|
|
{
|
|
|
|
|
|
- _chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage / 10) * (_chargingData[_index]->PresentChargingCurrent / 10)) / 1000);
|
|
|
+ _chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage) * (_chargingData[_index]->PresentChargingCurrent)) / 1000);
|
|
|
|
|
|
if (chargingTime[_index] == 0)
|
|
|
{
|