|
@@ -37,6 +37,8 @@
|
|
|
#define YES 1
|
|
|
#define NO 0
|
|
|
#define TEN_MINUTES 600
|
|
|
+#define ENV_TEMP_MIN 45
|
|
|
+#define ENV_TEMP_MAX 50
|
|
|
|
|
|
struct SysConfigAndInfo *ShmSysConfigAndInfo;
|
|
|
struct StatusCodeData *ShmStatusCodeData;
|
|
@@ -44,9 +46,10 @@ struct FanModuleData *ShmFanModuleData;
|
|
|
struct RelayModuleData *ShmRelayModuleData;
|
|
|
struct CHAdeMOData *ShmCHAdeMOData;
|
|
|
struct CcsData *ShmCcsData;
|
|
|
+struct PsuData *ShmPsuData;
|
|
|
|
|
|
#define VIN_MAX_VOLTAGE 250 // 大於該值 : OVP
|
|
|
-#define VIN_MIN_VOLTAGE 170 // 小於該值 : UVP
|
|
|
+#define VIN_MIN_VOLTAGE 150 // 小於該值 : UVP
|
|
|
#define VIN_DROP_VOLTAGE 150 // 小於該值 : ac drop
|
|
|
|
|
|
#define VOUT_MAX_VOLTAGE 750
|
|
@@ -55,6 +58,7 @@ struct CcsData *ShmCcsData;
|
|
|
|
|
|
#define MAX_FAN_SPEED 13500
|
|
|
#define MIN_FAN_SPEED 2800
|
|
|
+#define NORMAL_FAN_SPEED 7000
|
|
|
|
|
|
// GFD Status
|
|
|
#define GFD_IDLE 0
|
|
@@ -164,16 +168,16 @@ unsigned short MaxValue(unsigned short value1, unsigned short value2)
|
|
|
|
|
|
void PRINTF_FUNC(char *string, ...)
|
|
|
{
|
|
|
- if (DEBUG)
|
|
|
- {
|
|
|
- va_list args;
|
|
|
- char buffer[4096];
|
|
|
+ va_list args;
|
|
|
+ char buffer[4096];
|
|
|
+ va_start(args, string);
|
|
|
+ vsnprintf(buffer, sizeof(buffer), string, args);
|
|
|
+ va_end(args);
|
|
|
|
|
|
- va_start(args, string);
|
|
|
- vsnprintf(buffer, sizeof(buffer), string, args);
|
|
|
- va_end(args);
|
|
|
+ if (DEBUG)
|
|
|
printf("%s \n", buffer);
|
|
|
- }
|
|
|
+ else
|
|
|
+ DEBUG_INFO("%s \n", buffer);
|
|
|
}
|
|
|
|
|
|
//==========================================
|
|
@@ -305,28 +309,26 @@ void GetPresentInputVol()
|
|
|
if (Query_Present_InputVoltage(Uart5Fd, Addr.Relay, &inputVoltage) == PASS)
|
|
|
{
|
|
|
// resolution : 0.1
|
|
|
- //PRINTF_FUNC("InputVoltageR = %f \n", inputVoltage.L1N_L12);
|
|
|
- //PRINTF_FUNC("InputVoltageS = %f \n", inputVoltage.L2N_L23);
|
|
|
- //PRINTF_FUNC("InputVoltageT = %f \n", inputVoltage.L3N_L31);
|
|
|
-
|
|
|
- ShmRelayModuleData->InputL1Volt = inputVoltage.L1N_L12;
|
|
|
- ShmRelayModuleData->InputL2Volt = inputVoltage.L2N_L23;
|
|
|
- ShmRelayModuleData->InputL3Volt = inputVoltage.L3N_L31;
|
|
|
+ ShmSysConfigAndInfo->SysInfo.InputVoltageR = ShmRelayModuleData->InputL1Volt = inputVoltage.L1N_L12;
|
|
|
+ ShmSysConfigAndInfo->SysInfo.InputVoltageS = ShmRelayModuleData->InputL2Volt = inputVoltage.L2N_L23;
|
|
|
+ ShmSysConfigAndInfo->SysInfo.InputVoltageT = ShmRelayModuleData->InputL3Volt = inputVoltage.L3N_L31;
|
|
|
|
|
|
//********************************************************************************************************//
|
|
|
// VIN < 170
|
|
|
if (inputVoltage.L1N_L12 < VIN_MIN_VOLTAGE)
|
|
|
- {
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP = 0x01;
|
|
|
- }
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP = YES;
|
|
|
+ else
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP = NO;
|
|
|
+
|
|
|
if (inputVoltage.L2N_L23 < VIN_MIN_VOLTAGE)
|
|
|
- {
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP = 0x01;
|
|
|
- }
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP = YES;
|
|
|
+ else
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP = NO;
|
|
|
+
|
|
|
if (inputVoltage.L3N_L31 < VIN_MIN_VOLTAGE)
|
|
|
- {
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP = 0x01;
|
|
|
- }
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP = YES;
|
|
|
+ else
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP = NO;
|
|
|
|
|
|
//********************************************************************************************************//
|
|
|
// VIN > 250
|
|
@@ -506,7 +508,6 @@ void CheckK1K2RelayOutput(byte index)
|
|
|
else
|
|
|
_chargingData[index]->RelayKPK2Status = NO;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else if (index == 1)
|
|
@@ -529,6 +530,9 @@ void CheckK1K2RelayOutput(byte index)
|
|
|
ShmSysConfigAndInfo->SysInfo.BridgeRelayStatus = YES;
|
|
|
else
|
|
|
ShmSysConfigAndInfo->SysInfo.BridgeRelayStatus = NO;
|
|
|
+
|
|
|
+// PRINTF_FUNC("Check Relay Output. index = %d, RelayKPK2Status = %d, BridgeRelayStatus = %d \n",
|
|
|
+// index, _chargingData[index]->RelayKPK2Status, ShmSysConfigAndInfo->SysInfo.BridgeRelayStatus);
|
|
|
}
|
|
|
|
|
|
void GetGfdAdc()
|
|
@@ -547,6 +551,8 @@ void GetGfdAdc()
|
|
|
{
|
|
|
DEBUG_ERROR("GFD Fail. index = %d, R = %d, Vol = %d \n",
|
|
|
i, gfd_adc.Resister_conn1, gfd_adc.voltage_conn1);
|
|
|
+ PRINTF_FUNC("GFD Fail. index = %d, R = %d, Vol = %d \n",
|
|
|
+ i, gfd_adc.Resister_conn1, gfd_adc.voltage_conn1);
|
|
|
}
|
|
|
}
|
|
|
else if (i == 1)
|
|
@@ -556,6 +562,8 @@ void GetGfdAdc()
|
|
|
{
|
|
|
DEBUG_ERROR("GFD Fail. index = %d, R = %d, Vol = %d \n",
|
|
|
i, gfd_adc.Resister_conn2, gfd_adc.voltage_conn2);
|
|
|
+ PRINTF_FUNC("GFD Fail. index = %d, R = %d, Vol = %d \n",
|
|
|
+ i, gfd_adc.Resister_conn2, gfd_adc.voltage_conn2);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -863,9 +871,19 @@ void SetK1K2RelayStatus(byte index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void CheckPhaseLossStatus(byte index)
|
|
|
+{
|
|
|
+ if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP == YES ||
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP == YES ||
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP == YES)
|
|
|
+ {
|
|
|
+ _chargingData[index]->StopChargeFlag = YES;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void SetParalleRelayStatus()
|
|
|
{
|
|
|
- if (gunCount >= 2 && ONE_CONNECTOR_USE == NO)
|
|
|
+ if (gunCount >= 2 && ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == NO)
|
|
|
{
|
|
|
if (_chargingData[0]->SystemStatus == S_BOOTING || _chargingData[1]->SystemStatus == S_BOOTING)
|
|
|
{
|
|
@@ -877,33 +895,49 @@ void SetParalleRelayStatus()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // 單槍充電中 - 搭上橋接
|
|
|
- if((_chargingData[0]->IsReadyToCharging == YES && _chargingData[1]->IsReadyToCharging == NO) ||
|
|
|
- (_chargingData[0]->IsReadyToCharging == NO && _chargingData[1]->IsReadyToCharging == YES))
|
|
|
+ if (_chargingData[0]->IsReadyToCharging == YES ||
|
|
|
+ _chargingData[1]->IsReadyToCharging == YES)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_RELAY)
|
|
|
+ // ************需考慮在切換中 - 切開 relay 與搭回 relay 的時機點************
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
|
|
|
{
|
|
|
- if (regRelay.relay_event.bits.Gun1_Parallel_P == YES)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_P = NO;
|
|
|
- else if (regRelay.relay_event.bits.Gun1_Parallel_N == YES)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_N = NO;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag < _REASSIGNED_RELAY_M_TO_A)
|
|
|
+ {
|
|
|
+ // 最大充 - 搭上橋接
|
|
|
+ if (regRelay.relay_event.bits.Gun1_Parallel_N == NO)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_N = YES;
|
|
|
+ else if (regRelay.relay_event.bits.Gun1_Parallel_P == NO)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_P = YES;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 平均充 - 不搭
|
|
|
+ if (regRelay.relay_event.bits.Gun1_Parallel_P == YES)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_P = NO;
|
|
|
+ else if (regRelay.relay_event.bits.Gun1_Parallel_N == YES)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_N = NO;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ else if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
|
|
|
{
|
|
|
- if (regRelay.relay_event.bits.Gun1_Parallel_N == NO)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_N = YES;
|
|
|
- else if (regRelay.relay_event.bits.Gun1_Parallel_P == NO)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_P = YES;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag < _REASSIGNED_RELAY_A_TO_M)
|
|
|
+ {
|
|
|
+ // 平均充 - 不搭
|
|
|
+ if (regRelay.relay_event.bits.Gun1_Parallel_P == YES)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_P = NO;
|
|
|
+ else if (regRelay.relay_event.bits.Gun1_Parallel_N == YES)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_N = NO;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 最大充 - 搭上橋接
|
|
|
+ if (regRelay.relay_event.bits.Gun1_Parallel_N == NO)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_N = YES;
|
|
|
+ else if (regRelay.relay_event.bits.Gun1_Parallel_P == NO)
|
|
|
+ outputRelay.relay_event.bits.Gun1_Parallel_P = YES;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- // 雙槍充電中~ 不搭橋接
|
|
|
- if (regRelay.relay_event.bits.Gun1_Parallel_P == YES)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_P = NO;
|
|
|
- else if (regRelay.relay_event.bits.Gun1_Parallel_N == YES)
|
|
|
- outputRelay.relay_event.bits.Gun1_Parallel_N = NO;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -979,6 +1013,23 @@ int InitShareMemory()
|
|
|
result = FAIL;
|
|
|
}
|
|
|
|
|
|
+ //creat ShmPsuData
|
|
|
+ if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ DEBUG_ERROR("shmget ShmPsuData NG \n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ DEBUG_ERROR("shmat ShmPsuData NG \n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ memset(ShmPsuData,0,sizeof(struct PsuData));
|
|
|
+
|
|
|
if(CHAdeMO_QUANTITY > 0)
|
|
|
{
|
|
|
if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0)
|
|
@@ -1226,7 +1277,9 @@ void CheckOutputPowerOverCarReq(byte index)
|
|
|
float carV = _chargingData[index]->EvBatterytargetVoltage;
|
|
|
|
|
|
if (_chargingData[index]->EvBatterytargetVoltage > 1500 &&
|
|
|
- (_chargingData[index]->Type == _Type_Chademo || _chargingData[index]->Type == _Type_CCS_2 || _chargingData[index]->Type == _Type_GB))
|
|
|
+ (_chargingData[index]->Type == _Type_Chademo ||
|
|
|
+ _chargingData[index]->Type == _Type_CCS_2 ||
|
|
|
+ _chargingData[index]->Type == _Type_GB))
|
|
|
{
|
|
|
if (fireV >= (carV + (carV * 0.1)))
|
|
|
{
|
|
@@ -1242,7 +1295,9 @@ void CheckOutputPowerOverCarReq(byte index)
|
|
|
void CheckOutputVolNoneMatchFire(byte index)
|
|
|
{
|
|
|
if (_chargingData[index]->EvBatterytargetVoltage > 1500 &&
|
|
|
- (_chargingData[index]->Type == _Type_Chademo || _chargingData[index]->Type == _Type_CCS_2 || _chargingData[index]->Type == _Type_GB))
|
|
|
+ (_chargingData[index]->Type == _Type_Chademo ||
|
|
|
+ _chargingData[index]->Type == _Type_CCS_2 ||
|
|
|
+ _chargingData[index]->Type == _Type_GB))
|
|
|
{
|
|
|
if ((_chargingData[index]->PresentChargingVoltage < _chargingData[index]->FireChargingVoltage - 300) ||
|
|
|
(_chargingData[index]->PresentChargingVoltage > _chargingData[index]->FireChargingVoltage + 300))
|
|
@@ -1256,17 +1311,45 @@ void CheckOutputVolNoneMatchFire(byte index)
|
|
|
{
|
|
|
if ((GetTimeoutValue(_checkOutputNoneMatchTimer[index]) / 1000) >= 5000)
|
|
|
{
|
|
|
- PRINTF_FUNC("[Module_InternalComm]CheckOutputVolNoneMatchFire NG : pre = %f, fire = %f \n",
|
|
|
- _chargingData[index]->PresentChargingVoltage, _chargingData[index]->FireChargingVoltage);
|
|
|
- DEBUG_ERROR("[Module_InternalComm]CheckOutputVolNoneMatchFire NG : pre = %f, fire = %f \n",
|
|
|
- _chargingData[index]->PresentChargingVoltage, _chargingData[index]->FireChargingVoltage);
|
|
|
+ PRINTF_FUNC("[Module_InternalComm]CheckOutputVolNoneMatchFire NG (%d) : pre = %f, fire = %f \n",
|
|
|
+ index, _chargingData[index]->PresentChargingVoltage, _chargingData[index]->FireChargingVoltage);
|
|
|
+ DEBUG_ERROR("[Module_InternalComm]CheckOutputVolNoneMatchFire NG (%d): pre = %f, fire = %f \n",
|
|
|
+ index, _chargingData[index]->PresentChargingVoltage, _chargingData[index]->FireChargingVoltage);
|
|
|
_chargingData[index]->StopChargeFlag = YES;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ _isOutputNoneMatch[index] = NO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void GetPsuTempForFanSpeed()
|
|
|
+{
|
|
|
+ char temp = 0;
|
|
|
+ for (byte index = 0; index < ShmPsuData->GroupCount; index++)
|
|
|
+ {
|
|
|
+ for (byte count = 0; count < ShmPsuData->PsuGroup[index].GroupPresentPsuQuantity; count++)
|
|
|
+ {
|
|
|
+ if (temp < ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp)
|
|
|
+ temp = ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ShmFanModuleData->TestFanSpeed == NORMAL_FAN_SPEED)
|
|
|
+ {
|
|
|
+ if (temp >= ENV_TEMP_MAX)
|
|
|
+ ShmFanModuleData->TestFanSpeed = MAX_FAN_SPEED;
|
|
|
+ }
|
|
|
+ else if (ShmFanModuleData->TestFanSpeed == MAX_FAN_SPEED)
|
|
|
+ {
|
|
|
+ if (temp <= ENV_TEMP_MIN)
|
|
|
+ ShmFanModuleData->TestFanSpeed = NORMAL_FAN_SPEED;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ ShmFanModuleData->TestFanSpeed = NORMAL_FAN_SPEED;
|
|
|
+}
|
|
|
+
|
|
|
int main(void)
|
|
|
{
|
|
|
if(InitShareMemory() == FAIL)
|
|
@@ -1288,7 +1371,7 @@ int main(void)
|
|
|
|
|
|
if(Uart5Fd < 0)
|
|
|
{
|
|
|
- printf ("open port error. \n");
|
|
|
+ PRINTF_FUNC("(Internal) open port error. \n");
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -1348,6 +1431,9 @@ int main(void)
|
|
|
// 依據當前各槍的狀態選擇 搭上/放開 Relay
|
|
|
SetK1K2RelayStatus(i);
|
|
|
|
|
|
+ if (ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy == YES)
|
|
|
+ CheckPhaseLossStatus(i);
|
|
|
+
|
|
|
if (_chargingData[i]->SystemStatus == S_IDLE)
|
|
|
gfdChkFailCount[i] = 0;
|
|
|
|
|
@@ -1384,25 +1470,25 @@ int main(void)
|
|
|
else
|
|
|
outputRelay.relay_event.bits.AC_Contactor = NO;
|
|
|
|
|
|
-// if (isCharging)
|
|
|
-// {
|
|
|
-// isStopChargingCount = false;
|
|
|
-// outputRelay.relay_event.bits.AC_Contactor = YES;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if (!isStopChargingCount)
|
|
|
-// {
|
|
|
-// gettimeofday(&_close_ac_contactor, NULL);
|
|
|
-// isStopChargingCount = true;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if (!isSystemBooting ||
|
|
|
-// (outputRelay.relay_event.bits.AC_Contactor == YES && GetTimeoutValue(_close_ac_contactor) / 1000 >= (TEN_MINUTES * 1000)))
|
|
|
-// outputRelay.relay_event.bits.AC_Contactor = NO;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (isCharging)
|
|
|
+ {
|
|
|
+ isStopChargingCount = false;
|
|
|
+ outputRelay.relay_event.bits.AC_Contactor = YES;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!isStopChargingCount)
|
|
|
+ {
|
|
|
+ gettimeofday(&_close_ac_contactor, NULL);
|
|
|
+ isStopChargingCount = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!isSystemBooting ||
|
|
|
+ (outputRelay.relay_event.bits.AC_Contactor == YES && GetTimeoutValue(_close_ac_contactor) / 1000 >= (TEN_MINUTES * 1000)))
|
|
|
+ outputRelay.relay_event.bits.AC_Contactor = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 搭上/鬆開 Relay
|
|
|
// 放開 Relay 之前要先確認輸出的電壓電流是否已經降到某個值
|
|
@@ -1446,12 +1532,14 @@ int main(void)
|
|
|
{
|
|
|
if (GetTimeoutValue(_priority_time) / 1000 >= 1000)
|
|
|
{
|
|
|
+ GetPsuTempForFanSpeed();
|
|
|
+
|
|
|
GetFanSpeed();
|
|
|
+ // printf("ShmFanModuleData->PresentFan1Speed = %d \n", ShmFanModuleData->PresentFan1Speed);
|
|
|
+ // printf("ShmFanModuleData->PresentFan2Speed = %d \n", ShmFanModuleData->PresentFan2Speed);
|
|
|
+ // printf("ShmFanModuleData->PresentFan3Speed = %d \n", ShmFanModuleData->PresentFan3Speed);
|
|
|
+ // printf("ShmFanModuleData->PresentFan4Speed = %d \n", ShmFanModuleData->PresentFan4Speed);
|
|
|
gettimeofday(&_priority_time, NULL);
|
|
|
-// printf("ShmFanModuleData->PresentFan1Speed = %d \n", ShmFanModuleData->PresentFan1Speed);
|
|
|
-// printf("ShmFanModuleData->PresentFan2Speed = %d \n", ShmFanModuleData->PresentFan2Speed);
|
|
|
-// printf("ShmFanModuleData->PresentFan3Speed = %d \n", ShmFanModuleData->PresentFan3Speed);
|
|
|
-// printf("ShmFanModuleData->PresentFan4Speed = %d \n", ShmFanModuleData->PresentFan4Speed);
|
|
|
if (isCharging)
|
|
|
{
|
|
|
if (ShmFanModuleData->PresentFan1Speed < MAX_FAN_SPEED ||
|
|
@@ -1464,6 +1552,14 @@ int main(void)
|
|
|
ShmFanModuleData->SetFan3Speed = MAX_FAN_SPEED;
|
|
|
ShmFanModuleData->SetFan4Speed = MAX_FAN_SPEED;
|
|
|
}
|
|
|
+
|
|
|
+ if (ShmFanModuleData->TestFanSpeed > 0)
|
|
|
+ {
|
|
|
+ ShmFanModuleData->SetFan1Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
+ ShmFanModuleData->SetFan2Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
+ ShmFanModuleData->SetFan3Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
+ ShmFanModuleData->SetFan4Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1479,13 +1575,6 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (ShmFanModuleData->TestFanSpeed > 0)
|
|
|
- {
|
|
|
- ShmFanModuleData->SetFan1Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
- ShmFanModuleData->SetFan2Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
- ShmFanModuleData->SetFan3Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
- ShmFanModuleData->SetFan4Speed = ShmFanModuleData->TestFanSpeed;
|
|
|
- }
|
|
|
//PRINTF_FUNC("set fan = %d \n", ShmFanModuleData->SetFan1Speed);
|
|
|
SetFanModuleSpeed();
|
|
|
}
|