|
@@ -52,10 +52,10 @@
|
|
|
struct{
|
|
|
unsigned short int OV[3];
|
|
|
unsigned short int UV[3];
|
|
|
- unsigned short int OC;
|
|
|
+ unsigned short int OC[3];
|
|
|
unsigned short int OT_AMB;
|
|
|
unsigned short int GMI;
|
|
|
- unsigned short int Short;
|
|
|
+ unsigned short int Short[3];
|
|
|
unsigned short int Leakage;
|
|
|
unsigned short int HandShakingTimeout;
|
|
|
unsigned short int EmrgencyBTN;
|
|
@@ -787,30 +787,87 @@ int main(void)
|
|
|
//=====================================
|
|
|
// Current short detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_CIRCUIT_SHORT)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_CIRCUIT_SHORT)
|
|
|
{
|
|
|
- if(Alarm_Counter[gun_index].Short > FILTER_SPEC)
|
|
|
+ if(Alarm_Counter[gun_index].Short[0] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShort == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShort = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_CIRCUIT_SHORT;
|
|
|
- DEBUG_INFO("ALARM_CIRCUIT_SHORT : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L1_CIRCUIT_SHORT : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Alarm_Counter[gun_index].Short++;
|
|
|
+ Alarm_Counter[gun_index].Short[0]++;
|
|
|
}
|
|
|
}
|
|
|
- else if(!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_CIRCUIT_SHORT))
|
|
|
+ else if(!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_CIRCUIT_SHORT))
|
|
|
{
|
|
|
- Alarm_Counter[gun_index].Short = 0;
|
|
|
+ Alarm_Counter[gun_index].Short[0] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShort == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShort = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_CIRCUIT_SHORT;
|
|
|
- DEBUG_INFO("ALARM_CIRCUIT_SHORT : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L1_CIRCUIT_SHORT : recover \r\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_CIRCUIT_SHORT)
|
|
|
+ {
|
|
|
+ if(Alarm_Counter[gun_index].Short[1] > FILTER_SPEC)
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL2 == OFF)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL2 = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L2_CIRCUIT_SHORT : alarm \r\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Alarm_Counter[gun_index].Short[1]++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_CIRCUIT_SHORT))
|
|
|
+ {
|
|
|
+ Alarm_Counter[gun_index].Short[1] = 0;
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL2 == ON)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL2 = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L2_CIRCUIT_SHORT : recover \r\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_CIRCUIT_SHORT)
|
|
|
+ {
|
|
|
+ if(Alarm_Counter[gun_index].Short[2] > FILTER_SPEC)
|
|
|
+ {
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL3 == OFF)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL3 = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L3_CIRCUIT_SHORT : alarm \r\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Alarm_Counter[gun_index].Short[2]++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_CIRCUIT_SHORT))
|
|
|
+ {
|
|
|
+ Alarm_Counter[gun_index].Short[2] = 0;
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL3 == ON)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CircuitShortL3 = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_CIRCUIT_SHORT;
|
|
|
+ DEBUG_INFO("ALARM_L3_CIRCUIT_SHORT : recover \r\n");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1007,7 +1064,9 @@ int main(void)
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "PowerDrop");
|
|
|
}
|
|
|
- else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CIRCUIT_SHORT)
|
|
|
+ else if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L1_CIRCUIT_SHORT) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L2_CIRCUIT_SHORT) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L3_CIRCUIT_SHORT))
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "CircuitShort");
|