|
@@ -28,8 +28,6 @@ bool libInitialize = false;
|
|
|
byte getAvailableCapOffset = 5;
|
|
|
byte deratingKeepCount = 0;
|
|
|
|
|
|
-float carReqVol = 0;
|
|
|
-float carReqCur = 0;
|
|
|
float evseOutVol = 0;
|
|
|
float evseOutCur = 0;
|
|
|
|
|
@@ -321,6 +319,9 @@ void GetModuleCountCallback(byte group, byte count)
|
|
|
|
|
|
void GetMaxPowerAndCur(unsigned char mode, int ratingCur, int *pow, int *cur)
|
|
|
{
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
+ return;
|
|
|
+
|
|
|
unsigned short maxCurrent = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
|
|
|
unsigned short maxPower = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
|
|
|
|
|
@@ -342,7 +343,7 @@ void GetMaxPowerAndCur(unsigned char mode, int ratingCur, int *pow, int *cur)
|
|
|
|
|
|
void GetAvailableCapCallback(byte address, short maxVol, short minVol, short maxCur, short totalPow)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
int _groupPower = 0, _groupCurrent = 0;
|
|
@@ -462,7 +463,7 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
|
|
|
|
|
|
void GetFwCallback(byte address, short dcSwVer, short pfcSwVer, short hwVer)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
if (IsOverModuleCount(address))
|
|
@@ -481,7 +482,7 @@ void GetFwCallback(byte address, short dcSwVer, short pfcSwVer, short hwVer)
|
|
|
// no using -- GetInputVoltageCallback
|
|
|
void GetInputVoltageCallback(byte address, unsigned short vol1, unsigned short vol2, unsigned short vol3)
|
|
|
{
|
|
|
-// if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+// if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
// return;
|
|
|
//
|
|
|
// if (IsOverModuleCount(address))
|
|
@@ -504,7 +505,7 @@ void GetInputVoltageCallback(byte address, unsigned short vol1, unsigned short v
|
|
|
// no using -- GetOutputAndTempCallback
|
|
|
void GetPresentOutputCallback(byte group, unsigned short outVol, unsigned short outCur)
|
|
|
{
|
|
|
-// if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+// if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
// return;
|
|
|
|
|
|
//if (outCur != ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent)
|
|
@@ -598,7 +599,7 @@ void GetPresentOutputCallback(byte group, unsigned short outVol, unsigned short
|
|
|
|
|
|
void GetFanSpeedCallback(byte address, unsigned int fanSpeed)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
if (IsOverModuleCount(address))
|
|
@@ -617,7 +618,7 @@ void GetFanSpeedCallback(byte address, unsigned int fanSpeed)
|
|
|
|
|
|
void GetIavailableCallback(byte address, unsigned short Iavail, unsigned short Vext)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
if (IsOverModuleCount(address))
|
|
@@ -682,7 +683,7 @@ void GetIavailableCallback(byte address, unsigned short Iavail, unsigned short V
|
|
|
void GetOutputAndTempCallback(byte address, unsigned short outputVol_s,
|
|
|
unsigned short outputCur_s, unsigned short outputPower, unsigned char Temperature)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
unsigned short outVol = outputVol_s;
|
|
@@ -784,7 +785,7 @@ void GetOutputAndTempCallback(byte address, unsigned short outputVol_s,
|
|
|
void GetModuleStatusCallback(byte address, unsigned char isErr, unsigned char status,
|
|
|
unsigned char err1, unsigned char err2, unsigned char err3, unsigned char err4)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
if (IsOverModuleCount(address))
|
|
@@ -813,7 +814,7 @@ void GetModuleStatusCallback(byte address, unsigned char isErr, unsigned char st
|
|
|
void GetModuleInputCallback(byte address, unsigned short inputR,
|
|
|
unsigned short inputS, unsigned short inputT)
|
|
|
{
|
|
|
- if (ShmPsuData->Work_Step == INITIAL_START)
|
|
|
+ if (ShmPsuData->Work_Step < GET_SYS_CAP)
|
|
|
return;
|
|
|
|
|
|
if (IsOverModuleCount(address))
|
|
@@ -901,6 +902,7 @@ int InitShareMemory()
|
|
|
void InitialPsuData()
|
|
|
{
|
|
|
ShmPsuData->SystemPresentPsuQuantity = 0;
|
|
|
+ ShmPsuData->SystemAvailablePower = 0;
|
|
|
|
|
|
PRINTF_FUNC("************ psu Group = %d \n", ShmPsuData->GroupCount);
|
|
|
for (byte _groupCount = 0; _groupCount < ShmPsuData->GroupCount; _groupCount++)
|
|
@@ -1300,27 +1302,14 @@ int main(void)
|
|
|
(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 (chargingInfo[groupIndex]->EvBatterytargetVoltage > 0 &&
|
|
|
- carReqVol != chargingInfo[groupIndex]->EvBatterytargetVoltage)
|
|
|
- {
|
|
|
- carReqVol = chargingInfo[groupIndex]->EvBatterytargetVoltage;
|
|
|
- DEBUG_INFO("ev need vol = %f \n", chargingInfo[groupIndex]->EvBatterytargetVoltage);
|
|
|
- }
|
|
|
-
|
|
|
- if (chargingInfo[groupIndex]->EvBatterytargetCurrent > 0 &&
|
|
|
- carReqCur != chargingInfo[groupIndex]->EvBatterytargetCurrent)
|
|
|
- {
|
|
|
- carReqCur = chargingInfo[groupIndex]->EvBatterytargetCurrent;
|
|
|
- DEBUG_INFO("ev need cur = %f \n", chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
- }
|
|
|
-
|
|
|
if (time > 1500)
|
|
|
{
|
|
|
if (chargingInfo[groupIndex]->FireChargingVoltage > 0 &&
|
|
|
evseOutVol != (chargingInfo[groupIndex]->FireChargingVoltage / 10))
|
|
|
{
|
|
|
evseOutVol = (chargingInfo[groupIndex]->FireChargingVoltage / 10);
|
|
|
- PRINTF_FUNC("groupIndex = %d, evse output vol = %f \n", groupIndex,
|
|
|
+ PRINTF_FUNC("groupIndex = %d, ev need vol = %f, evse output vol = %f \n", groupIndex,
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
|
|
|
chargingInfo[groupIndex]->FireChargingVoltage);
|
|
|
}
|
|
|
|
|
@@ -1329,6 +1318,7 @@ int main(void)
|
|
|
{
|
|
|
evseOutCur = (chargingInfo[groupIndex]->PresentChargingCurrent * 10);
|
|
|
PRINTF_FUNC("groupIndex = %d, evse output cur = %f \n", groupIndex,
|
|
|
+ (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10),
|
|
|
(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
|
|
|
}
|
|
|
}
|
|
@@ -1513,7 +1503,8 @@ int main(void)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //PRINTF_FUNC("set out (sys) value = %f******** 4 \n", chargingInfo[groupIndex]->EvBatterytargetCurrent);
|
|
|
+ PRINTF_FUNC("set out (sys) value = %f, smart step = %d******** 4 \n",
|
|
|
+ chargingInfo[groupIndex]->EvBatterytargetCurrent, ShmSysConfigAndInfo->SysInfo.ReAssignedFlag);
|
|
|
// 該充電槍的目標電壓與目標電流
|
|
|
PresentOutputVol(SYSTEM_CMD,
|
|
|
chargingInfo[groupIndex]->EvBatterytargetVoltage,
|