|
@@ -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;
|
|
@@ -264,15 +264,15 @@ int main(void)
|
|
|
//=====================================
|
|
|
// Over voltage detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_OVER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].OV[0] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputOVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputOVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L1_OVER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -280,28 +280,28 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].OV[0]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_OVER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].OV[0] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputOVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputOVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L1_OVER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
{
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].OV[1] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputOVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputOVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L2_OVER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -309,26 +309,26 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].OV[1]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].OV[1] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputOVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputOVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L2_OVER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].OV[2] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputOVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputOVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L3_OVER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -336,14 +336,14 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].OV[2]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].OV[2] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputOVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputOVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_OVER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L3_OVER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -351,15 +351,15 @@ int main(void)
|
|
|
//=====================================
|
|
|
// Under voltage detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_UNDER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].UV[0] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L1_UNDER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -367,28 +367,28 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].UV[0]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_UNDER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].UV[0] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L1_UNDER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
{
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_UNDER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].UV[1] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L2_UNDER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -396,26 +396,26 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].UV[1]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_UNDER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].UV[1] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L2_UNDER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_UNDER_VOLTAGE)
|
|
|
{
|
|
|
if(Alarm_Counter[gun_index].UV[2] > FILTER_SPEC)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L3_UNDER_VOLTAGE : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -423,77 +423,78 @@ int main(void)
|
|
|
Alarm_Counter[gun_index].UV[2]++;
|
|
|
}
|
|
|
}
|
|
|
- else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_UNDER_VOLTAGE)))
|
|
|
+ else if((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_UNDER_VOLTAGE)))
|
|
|
{
|
|
|
Alarm_Counter[gun_index].UV[2] = 0;
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_UNDER_VOLTAGE;
|
|
|
- DEBUG_INFO("ALARM_UNDER_VOLTAGE : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_UNDER_VOLTAGE;
|
|
|
+ DEBUG_INFO("ALARM_L3_UNDER_VOLTAGE : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//=====================================
|
|
|
// Over current detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_OVER_CURRENT)
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : alarm \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L1_OVER_CURRENT : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
- else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)))
|
|
|
+ else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L1_OVER_CURRENT)))
|
|
|
{
|
|
|
if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : recover \r\n");
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L1_OVER_CURRENT : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
{
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_CURRENT)
|
|
|
{
|
|
|
- if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
|
|
|
{
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : alarm \r\n");
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
- else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)))
|
|
|
+ else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L2_OVER_CURRENT)))
|
|
|
{
|
|
|
- if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
|
|
|
{
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : recover \r\n");
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_CURRENT)
|
|
|
{
|
|
|
- if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
|
|
|
{
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : alarm \r\n");
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \r\n");
|
|
|
}
|
|
|
}
|
|
|
- else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_OVER_CURRENT)))
|
|
|
+ else if ((!(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_L3_OVER_CURRENT)))
|
|
|
{
|
|
|
- if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
|
|
|
+ if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
|
|
|
{
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
|
|
|
- ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_OVER_CURRENT;
|
|
|
- DEBUG_INFO("ALARM_OVER_CURRENT : recover \r\n");
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
|
|
|
+ ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
|
|
|
+ DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover \r\n");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -786,30 +787,87 @@ int main(void)
|
|
|
//=====================================
|
|
|
// Current short detection
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode & ALARM_CURRENT_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_CURRENT_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_CURRENT_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_CURRENT_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");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -926,15 +984,21 @@ int main(void)
|
|
|
//=====================================
|
|
|
// OCPP error code message
|
|
|
//=====================================
|
|
|
- if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_OVER_VOLTAGE)
|
|
|
+ if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L1_OVER_VOLTAGE) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L2_OVER_VOLTAGE) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L3_OVER_VOLTAGE))
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OverVoltage");
|
|
|
}
|
|
|
- else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_UNDER_VOLTAGE)
|
|
|
+ else if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L1_UNDER_VOLTAGE) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L2_UNDER_VOLTAGE) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L3_UNDER_VOLTAGE))
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "UnderVoltage");
|
|
|
}
|
|
|
- else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_OVER_CURRENT)
|
|
|
+ else if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L1_OVER_CURRENT) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L2_OVER_CURRENT) ||
|
|
|
+ (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_L3_OVER_CURRENT))
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OverCurrentFailure");
|
|
|
}
|
|
@@ -1000,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_CURRENT_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");
|
|
@@ -1050,6 +1116,8 @@ int main(void)
|
|
|
TODO: Recover latch alarm here
|
|
|
*/
|
|
|
}
|
|
|
+
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.CSUAlarmStatusCode = ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode;
|
|
|
}
|
|
|
|
|
|
usleep(100000);
|