|
@@ -350,14 +350,58 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
int _groupPower = 0, _groupCurrent = 0;
|
|
|
byte group = FindTargetGroup(address);
|
|
|
+ float _chargingVol = 0, _targetVol = 0;
|
|
|
|
|
|
if (group == 1)
|
|
|
address -= ShmPsuData->PsuGroup[group - 1].GroupPresentPsuQuantity;
|
|
|
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
|
|
|
+ {
|
|
|
+ for (byte groupIndex = 0; groupIndex < _gunCount; groupIndex++)
|
|
|
+ {
|
|
|
+ if (chargingInfo[groupIndex]->EvBatteryMaxVoltage > 0)
|
|
|
+ {
|
|
|
+ _chargingVol = chargingInfo[groupIndex]->EvBatteryMaxVoltage;
|
|
|
+ _targetVol = chargingInfo[groupIndex]->EvBatterytargetVoltage;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (chargingInfo[group]->DeratingChargingCurrent == 0)
|
|
|
- ShmPsuData->PsuGroup[group].PsuModule[address].AvailableCurrent = PSU_MIN_CUR;
|
|
|
+ {
|
|
|
+
|
|
|
+ if (ShmPsuData->PsuGroup[group].GroupRealOutputPower > 0 && _chargingVol > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ShmPsuData->PsuGroup[group].PsuModule[address].AvailableCurrent =
|
|
|
+ ((ShmPsuData->PsuGroup[group].GroupRealOutputPower / ShmPsuData->PsuGroup[group].GroupPresentPsuQuantity) * 1000 / (int)_chargingVol) * 10;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ if (ShmPsuData->PsuGroup[group].PsuModule[address].AvailableCurrent <= 0)
|
|
|
+ ShmPsuData->PsuGroup[group].PsuModule[address].AvailableCurrent = PSU_MIN_CUR;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
else
|
|
|
+ {
|
|
|
ShmPsuData->PsuGroup[group].PsuModule[address].AvailableCurrent = maxCur;
|
|
|
+ }
|
|
|
|
|
|
ShmPsuData->PsuGroup[group].PsuModule[address].AvailablePower = totalPow;
|
|
|
|
|
@@ -373,7 +417,7 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
chargingInfo[group]->MaximumChargingVoltage = maxVol;
|
|
|
|
|
|
- int _power = 0, _current = 0, _ratingcurrent = 0;
|
|
|
+ int _power = 0, _current = 0, _ratingcurrent = 0, _sysRealPower = 0;
|
|
|
bool isGetAllDeratingCurrent = true;
|
|
|
|
|
|
for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
@@ -381,6 +425,7 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
_power += ShmPsuData->PsuGroup[index].GroupAvailablePower;
|
|
|
_current += ShmPsuData->PsuGroup[index].GroupAvailableCurrent;
|
|
|
_ratingcurrent += chargingInfo[index]->DeratingChargingCurrent;
|
|
|
+ _sysRealPower += ShmPsuData->PsuGroup[index].GroupRealOutputPower;
|
|
|
if (ShmPsuData->PsuGroup[index].GroupPresentOutputVoltage >= PSU_MIN_VOL &&
|
|
|
chargingInfo[index]->DeratingChargingCurrent == 0)
|
|
|
isGetAllDeratingCurrent = false;
|
|
@@ -388,7 +433,13 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
|
|
|
if (!isGetAllDeratingCurrent) _ratingcurrent = 0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (_ratingcurrent != 0) _current = _ratingcurrent;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
ShmPsuData->SystemAvailableCurrent = _current;
|
|
|
ShmPsuData->SystemAvailablePower = _power;
|
|
|
|
|
@@ -399,6 +450,7 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
int halfPow = ShmPsuData->PsuGroup[group].GroupAvailablePower;
|
|
|
int halfCur = ShmPsuData->PsuGroup[group].GroupAvailableCurrent;
|
|
|
int ratingCur = chargingInfo[group]->DeratingChargingCurrent;
|
|
|
+ int gpRealPow = ShmPsuData->PsuGroup[group].GroupRealOutputPower;
|
|
|
|
|
|
if ((ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_GET_NEW_CAP &&
|
|
|
ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A))
|
|
@@ -427,16 +479,27 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
chargingInfo[group]->AvailableChargingCurrent = halfCur;
|
|
|
chargingInfo[group]->AvailableChargingPower = halfPow;
|
|
|
+ chargingInfo[group]->RealRatingPower = gpRealPow;
|
|
|
|
|
|
if(chargingInfo[group]->DeratingChargingCurrent > 0)
|
|
|
{
|
|
|
- chargingInfo[group]->RealRatingPower = (chargingInfo[group]->DeratingChargingCurrent * chargingInfo[group]->PresentChargingVoltage) / 100000;
|
|
|
+ unsigned short _powBuf = 0;
|
|
|
+ _powBuf = ((chargingInfo[group]->DeratingChargingCurrent / 10) * ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage / 10) / 1000;
|
|
|
+
|
|
|
+ if (_powBuf > ShmPsuData->PsuGroup[group].GroupRealOutputPower ||
|
|
|
+ chargingInfo[group]->EvBatterytargetVoltage > 0)
|
|
|
+ {
|
|
|
+ ShmPsuData->PsuGroup[group].GroupRealOutputPower = _powBuf;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
|
|
|
{
|
|
|
+
|
|
|
GetMaxPowerAndCur(_MAIN_CHARGING_MODE_MAX, _ratingcurrent, &_power, &_current);
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
|
|
@@ -446,6 +509,7 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
chargingInfo[count]->MaximumChargingVoltage = maxVol;
|
|
|
chargingInfo[count]->AvailableChargingCurrent = _current;
|
|
|
chargingInfo[count]->AvailableChargingPower = _power;
|
|
|
+ chargingInfo[count]->RealRatingPower = _sysRealPower;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -453,13 +517,21 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
chargingInfo[group]->AvailableChargingCurrent = _current;
|
|
|
chargingInfo[group]->AvailableChargingPower = _power;
|
|
|
+ chargingInfo[group]->RealRatingPower = _sysRealPower;
|
|
|
}
|
|
|
|
|
|
- if(_ratingcurrent > 0)
|
|
|
+ if(chargingInfo[group]->DeratingChargingCurrent > 0)
|
|
|
{
|
|
|
- chargingInfo[group]->RealRatingPower = (_ratingcurrent * chargingInfo[group]->PresentChargingVoltage) / 100000;
|
|
|
+ unsigned short _powBuf = 0;
|
|
|
+ _powBuf = ((chargingInfo[group]->DeratingChargingCurrent / 10) * ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage / 10) / 1000;
|
|
|
+
|
|
|
+ if (_powBuf > ShmPsuData->PsuGroup[group].GroupRealOutputPower ||
|
|
|
+ chargingInfo[group]->EvBatterytargetVoltage > 0 ||
|
|
|
+ _targetVol > 0)
|
|
|
+ {
|
|
|
+ ShmPsuData->PsuGroup[group].GroupRealOutputPower = _powBuf;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -637,10 +709,11 @@ void GetIavailableCallback(byte address, unsigned short Iavail, unsigned short V
|
|
|
|
|
|
bool isPass = true;
|
|
|
int totalCur = 0;
|
|
|
+ byte sampleCount = 8;
|
|
|
|
|
|
if (Iavail == 0)
|
|
|
{
|
|
|
- for (byte count = 0; count < 2; count++)
|
|
|
+ for (byte count = 0; count < sampleCount; count++)
|
|
|
{
|
|
|
chargingInfo[group]->SampleChargingCur[count] = Iavail;
|
|
|
}
|
|
@@ -653,7 +726,7 @@ void GetIavailableCallback(byte address, unsigned short Iavail, unsigned short V
|
|
|
totalCur += ShmPsuData->PsuGroup[group].PsuModule[index].IAvailableCurrent;
|
|
|
}
|
|
|
|
|
|
- for (byte count = 0; count < 2; count++)
|
|
|
+ for (byte count = 0; count < sampleCount; count++)
|
|
|
{
|
|
|
if (chargingInfo[group]->SampleChargingCur[count] == 0)
|
|
|
{
|
|
@@ -674,106 +747,223 @@ void GetIavailableCallback(byte address, unsigned short Iavail, unsigned short V
|
|
|
|
|
|
if (isPass)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
chargingInfo[group]->DeratingChargingCurrent = totalCur;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-void GetOutputAndTempCallback(byte address, unsigned short outputVol_s,
|
|
|
- unsigned short outputCur_s, unsigned short outputPower, unsigned char Temperature)
|
|
|
+void GetPresentOutputFCallback(byte group, float outVol, float outCur)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
- return;
|
|
|
-
|
|
|
- unsigned short outVol = outputVol_s;
|
|
|
- unsigned short outCur = outputCur_s;
|
|
|
-
|
|
|
- if (IsOverModuleCount(address))
|
|
|
- return;
|
|
|
+
|
|
|
+ if (isinf(outVol) == 0)
|
|
|
+ ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage = (unsigned short)(outVol * 10);
|
|
|
+ else
|
|
|
+ ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage = 0;
|
|
|
|
|
|
- byte group = FindTargetGroup(address);
|
|
|
+ if (isinf(outCur) == 0)
|
|
|
+ ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent = (unsigned short)(outCur * 10);
|
|
|
+ else
|
|
|
+ ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent = 0;
|
|
|
|
|
|
- if (group == 1)
|
|
|
- address -= ShmPsuData->PsuGroup[group - 1].GroupPresentPsuQuantity;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX ||
|
|
|
+ (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER &&
|
|
|
+ (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_WAITING &&
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_COMP))
|
|
|
+ )
|
|
|
+ {
|
|
|
+ unsigned short outputVol = 0;
|
|
|
+ unsigned short outputCur = 0;
|
|
|
+ unsigned char _maxTOaver = 0;
|
|
|
|
|
|
-
|
|
|
- ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage = outVol;
|
|
|
-
|
|
|
- ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent = outCur;
|
|
|
+ for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
|
+ {
|
|
|
+ bool needtoAdd = true;
|
|
|
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX ||
|
|
|
- (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER &&
|
|
|
- (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_WAITING &&
|
|
|
- ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_COMP))
|
|
|
- )
|
|
|
- {
|
|
|
- unsigned short outputVol = 0;
|
|
|
- unsigned short outputCur = 0;
|
|
|
+ if (ShmPsuData->PsuGroup[index].GroupPresentOutputVoltage > outputVol)
|
|
|
+ outputVol = ShmPsuData->PsuGroup[index].GroupPresentOutputVoltage;
|
|
|
|
|
|
- for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
|
- {
|
|
|
- bool needtoAdd = true;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_ADJUST_M_TO_A &&
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A)
|
|
|
+ {
|
|
|
+ if (chargingInfo[index]->DividChargingCurrent == 0)
|
|
|
+ needtoAdd = false;
|
|
|
+ else
|
|
|
+ _maxTOaver = index;
|
|
|
+ }
|
|
|
|
|
|
- if (ShmPsuData->PsuGroup[index].GroupPresentOutputVoltage > outputVol)
|
|
|
- outputVol = ShmPsuData->PsuGroup[index].GroupPresentOutputVoltage;
|
|
|
+ if (needtoAdd)
|
|
|
+ outputCur += ShmPsuData->PsuGroup[index].GroupPresentOutputCurrent;
|
|
|
+ }
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_ADJUST_M_TO_A &&
|
|
|
ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A)
|
|
|
{
|
|
|
- if (chargingInfo[index]->DividChargingCurrent == 0)
|
|
|
- needtoAdd = false;
|
|
|
+ if (chargingInfo[_maxTOaver]->DividChargingCurrent != 0)
|
|
|
+ {
|
|
|
+ float _cur_buf = outputCur;
|
|
|
+ _cur_buf /= 10;
|
|
|
+ chargingInfo[_maxTOaver]->PresentChargingCurrent = _cur_buf;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if (needtoAdd)
|
|
|
- outputCur += ShmPsuData->PsuGroup[index].GroupPresentOutputCurrent;
|
|
|
- }
|
|
|
+
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
|
|
|
+ {
|
|
|
+ for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; count++)
|
|
|
+ {
|
|
|
+ float _vol_buf = outputVol;
|
|
|
+ float _cur_buf = outputCur;
|
|
|
|
|
|
-
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
|
|
|
- {
|
|
|
- for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; count++)
|
|
|
+
|
|
|
+ _vol_buf /= 10;
|
|
|
+ chargingInfo[count]->PresentChargingVoltage = _vol_buf;
|
|
|
+
|
|
|
+ _cur_buf /= 10;
|
|
|
+ chargingInfo[count]->PresentChargingCurrent = _cur_buf;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((chargingInfo[group]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[group]->SystemStatus <= S_COMPLETE) ||
|
|
|
+ (chargingInfo[group]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[group]->SystemStatus <= S_CCS_PRECHARGE_ST1))
|
|
|
{
|
|
|
float _vol_buf = outputVol;
|
|
|
float _cur_buf = outputCur;
|
|
|
|
|
|
|
|
|
_vol_buf /= 10;
|
|
|
- chargingInfo[count]->PresentChargingVoltage = _vol_buf;
|
|
|
-
|
|
|
+ chargingInfo[group]->PresentChargingVoltage = _vol_buf;
|
|
|
+
|
|
|
_cur_buf /= 10;
|
|
|
- chargingInfo[count]->PresentChargingCurrent = _cur_buf;
|
|
|
+ chargingInfo[group]->PresentChargingCurrent = _cur_buf;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if ((chargingInfo[group]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[group]->SystemStatus <= S_COMPLETE) ||
|
|
|
- (chargingInfo[group]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[group]->SystemStatus <= S_CCS_PRECHARGE_ST1))
|
|
|
+ else
|
|
|
{
|
|
|
- float _vol_buf = outputVol;
|
|
|
- float _cur_buf = outputCur;
|
|
|
+ float _vol_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage;
|
|
|
+ float _cur_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent;
|
|
|
|
|
|
|
|
|
_vol_buf /= 10;
|
|
|
chargingInfo[group]->PresentChargingVoltage = _vol_buf;
|
|
|
-
|
|
|
+
|
|
|
_cur_buf /= 10;
|
|
|
chargingInfo[group]->PresentChargingCurrent = _cur_buf;
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- float _vol_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage;
|
|
|
- float _cur_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent;
|
|
|
-
|
|
|
-
|
|
|
- _vol_buf /= 10;
|
|
|
- chargingInfo[group]->PresentChargingVoltage = _vol_buf;
|
|
|
-
|
|
|
- _cur_buf /= 10;
|
|
|
- chargingInfo[group]->PresentChargingCurrent = _cur_buf;
|
|
|
- }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+void GetOutputAndTempCallback(byte address, unsigned short outputVol_s,
|
|
|
+ unsigned short outputCur_s, unsigned short outputPower, unsigned char Temperature)
|
|
|
+{
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
+ return;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (IsOverModuleCount(address))
|
|
|
+ return;
|
|
|
+
|
|
|
+ byte group = FindTargetGroup(address);
|
|
|
+
|
|
|
+ if (group == 1)
|
|
|
+ address -= ShmPsuData->PsuGroup[group - 1].GroupPresentPsuQuantity;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
ShmPsuData->PsuGroup[group].PsuModule[address].CriticalTemp1 = Temperature;
|
|
|
ShmPsuData->PsuGroup[group].PsuModule[address].CriticalTemp2 = Temperature;
|
|
@@ -953,6 +1143,8 @@ void Initialization()
|
|
|
count = 1;
|
|
|
else if (strcmp(EvsePower, "60") == EQUAL)
|
|
|
count = 2;
|
|
|
+ else if (strcmp(EvsePower, "12") == EQUAL)
|
|
|
+ count = 4;
|
|
|
else if (strcmp(EvsePower, "18") == EQUAL)
|
|
|
count = 6;
|
|
|
else if (strcmp(EvsePower, "36") == EQUAL)
|
|
@@ -1074,6 +1266,7 @@ int main(void)
|
|
|
RefreshGetOutput(&GetPresentOutputCallback);
|
|
|
RefreshFanInfo(&GetFanSpeedCallback);
|
|
|
RefreshIavailable(&GetIavailableCallback);
|
|
|
+ RefreshGetOutputF(&GetPresentOutputFCallback);
|
|
|
|
|
|
|
|
|
AutoMode_RefreshOutputAndTemp(&GetOutputAndTempCallback);
|
|
@@ -1138,8 +1331,6 @@ int main(void)
|
|
|
|
|
|
if (time > 2000)
|
|
|
{
|
|
|
- PRINTF_FUNC("== PSU == indexCount = %d, moduleCount = %d, sysCount = %d\n",
|
|
|
- ShmPsuData->GroupCount, moduleCount, ShmPsuData->SystemPresentPsuQuantity);
|
|
|
|
|
|
|
|
|
|
|
@@ -1151,6 +1342,8 @@ int main(void)
|
|
|
|
|
|
GetModuleCount(index);
|
|
|
}
|
|
|
+ PRINTF_FUNC("== PSU == indexCount = %d, moduleCount = %d, sysCount = %d\n",
|
|
|
+ ShmPsuData->GroupCount, moduleCount, ShmPsuData->SystemPresentPsuQuantity);
|
|
|
|
|
|
|
|
|
GetModuleCount(SYSTEM_CMD);
|
|
@@ -1175,7 +1368,6 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- _getCapDelayCount = 7;
|
|
|
gettimeofday(&_cmdSubPriority_time, NULL);
|
|
|
}
|
|
|
}
|
|
@@ -1186,30 +1378,42 @@ int main(void)
|
|
|
|
|
|
if (time > 1000)
|
|
|
{
|
|
|
- for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
|
+ bool isFinish = true;
|
|
|
+ for (byte psuCount = 0; psuCount < ShmPsuData->SystemPresentPsuQuantity; psuCount++)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
+ if (strcmp((char *)ShmPsuData->PsuVersion[psuCount].FwPrimaryVersion, "") == EQUAL ||
|
|
|
+ ShmPsuData->SystemAvailablePower <= 0 || ShmPsuData->SystemAvailableCurrent <= 0)
|
|
|
+ {
|
|
|
+ isFinish = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- GetModuleCap(index);
|
|
|
+ if (!isFinish)
|
|
|
+ {
|
|
|
+ for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- GetModuleVer(index);
|
|
|
- }
|
|
|
- _getCapDelayCount--;
|
|
|
- gettimeofday(&_cmdSubPriority_time, NULL);
|
|
|
- }
|
|
|
+
|
|
|
+ GetModuleCap(index);
|
|
|
|
|
|
-
|
|
|
- if (ShmPsuData->SystemAvailablePower > 0 && ShmPsuData->SystemAvailableCurrent > 0 &&
|
|
|
- _getCapDelayCount <= 0)
|
|
|
- {
|
|
|
- PRINTF_FUNC("SystemAvailableCurrent = %d, SystemAvailablePower = %d \n",
|
|
|
+
|
|
|
+ GetModuleVer(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ PRINTF_FUNC("SystemAvailableCurrent = %d, SystemAvailablePower = %d \n",
|
|
|
ShmPsuData->SystemAvailableCurrent, ShmPsuData->SystemAvailablePower);
|
|
|
|
|
|
- PRINTF_FUNC("== PSU == BOOTING_COMPLETE \n");
|
|
|
- ShmPsuData->Work_Step = BOOTING_COMPLETE;
|
|
|
+ PRINTF_FUNC("== PSU == BOOTING_COMPLETE \n");
|
|
|
+ ShmPsuData->Work_Step = BOOTING_COMPLETE;
|
|
|
+ }
|
|
|
+
|
|
|
+ gettimeofday(&_cmdSubPriority_time, NULL);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -1247,7 +1451,7 @@ int main(void)
|
|
|
|
|
|
|
|
|
|
|
|
- GetModuleIavailable(index);
|
|
|
+
|
|
|
|
|
|
if (chargingInfo[index]->SystemStatus == S_CHARGING)
|
|
|
{
|
|
@@ -1301,12 +1505,18 @@ int main(void)
|
|
|
|
|
|
GetModuleCap(groupIndex);
|
|
|
|
|
|
+
|
|
|
+ GetModuleOutputF(groupIndex);
|
|
|
+
|
|
|
+
|
|
|
+ GetModuleIavailable(groupIndex);
|
|
|
+
|
|
|
|
|
|
if (((chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[groupIndex]->SystemStatus <= S_CHARGING) && chargingInfo[groupIndex]->RelayK1K2Status) ||
|
|
|
(chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[groupIndex]->SystemStatus <= S_CHARGING && chargingInfo[groupIndex]->Type == _Type_GB) ||
|
|
|
(chargingInfo[groupIndex]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[groupIndex]->SystemStatus <= S_CCS_PRECHARGE_ST1))
|
|
|
{
|
|
|
- if (time > 1500)
|
|
|
+
|
|
|
{
|
|
|
if (chargingInfo[groupIndex]->FireChargingVoltage > 0 &&
|
|
|
evseOutVol != (chargingInfo[groupIndex]->FireChargingVoltage / 10))
|
|
@@ -1321,7 +1531,7 @@ int main(void)
|
|
|
evseOutCur != (chargingInfo[groupIndex]->PresentChargingCurrent * 10))
|
|
|
{
|
|
|
evseOutCur = (chargingInfo[groupIndex]->PresentChargingCurrent * 10);
|
|
|
- PRINTF_FUNC("groupIndex = %d, evse output cur = %f \n", groupIndex,
|
|
|
+ PRINTF_FUNC("groupIndex = %d, ev need cur = %f, evse output cur = %f \n", groupIndex,
|
|
|
(chargingInfo[groupIndex]->EvBatterytargetCurrent * 10),
|
|
|
(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
|
|
|
}
|
|
@@ -1351,6 +1561,7 @@ int main(void)
|
|
|
else
|
|
|
{
|
|
|
chargingInfo[groupIndex]->DividChargingCurrent = 0;
|
|
|
+ chargingInfo[groupIndex]->MaxChargingToAverPassFlag = 0;
|
|
|
}
|
|
|
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_GET_NEW_CAP)
|
|
@@ -1459,8 +1670,10 @@ int main(void)
|
|
|
|
|
|
if (reassignIndex != ELEMENT_NOT_FIND)
|
|
|
{
|
|
|
- if ((GetTimeoutValue(_derating_time) / 1000) <= 50)
|
|
|
+ if ((GetTimeoutValue(_derating_time) / 1000) <= 50 ||
|
|
|
+ chargingInfo[groupIndex]->MaxChargingToAverPassFlag == 0)
|
|
|
{
|
|
|
+ chargingInfo[groupIndex]->MaxChargingToAverPassFlag = 1;
|
|
|
|
|
|
|
|
|
|
|
@@ -1505,7 +1718,7 @@ int main(void)
|
|
|
(chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
(chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
|
|
|
}
|
|
|
- else
|
|
|
+ else if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
|
|
|
{
|
|
|
|
|
|
|
|
@@ -1866,6 +2079,9 @@ int main(void)
|
|
|
{
|
|
|
|
|
|
GetModuleCap(index);
|
|
|
+
|
|
|
+
|
|
|
+ GetModuleOutputF(index);
|
|
|
}
|
|
|
|
|
|
gettimeofday(&_cmdSubPriority_time, NULL);
|
|
@@ -1880,7 +2096,7 @@ int main(void)
|
|
|
SetDirModulePresentOutput(connector_1[_groupCount_1],
|
|
|
(chargingInfo[0]->EvBatterytargetVoltage * 10),
|
|
|
(chargingInfo[0]->EvBatterytargetCurrent * 10),
|
|
|
- _switch);
|
|
|
+ _switch, _switch);
|
|
|
}
|
|
|
|
|
|
for (byte _groupCount_2 = 0; _groupCount_2 < conn_2_count; _groupCount_2++)
|
|
@@ -1888,7 +2104,7 @@ int main(void)
|
|
|
SetDirModulePresentOutput(connector_2[_groupCount_2],
|
|
|
(chargingInfo[0]->EvBatterytargetVoltage * 10),
|
|
|
(chargingInfo[0]->EvBatterytargetCurrent * 10),
|
|
|
- _switch);
|
|
|
+ _switch, _switch);
|
|
|
}
|
|
|
}
|
|
|
break;
|