|
@@ -100,7 +100,7 @@ unsigned char mask_table[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
|
|
|
void PRINTF_FUNC(char *string, ...);
|
|
|
|
|
|
void GetMaxVolAndCurMethod(byte index, float *vol, float *cur);
|
|
|
-void GetMaxPowerMethod(float *pow);
|
|
|
+void GetMaxPowerMethod(byte index, float *pow);
|
|
|
unsigned long GetTimeoutValue(struct timeval _sour_time);
|
|
|
|
|
|
#define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
@@ -2949,14 +2949,14 @@ void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct
|
|
|
|
|
|
vol = chargingData_1->MaximumChargingVoltage;
|
|
|
GetMaxVolAndCurMethod(chargingData_1->Index, &vol, &cur1);
|
|
|
- GetMaxPowerMethod(&pow1);
|
|
|
+ GetMaxPowerMethod(chargingData_1->Index, &pow1);
|
|
|
|
|
|
pow2 = chargingData_2->AvailableChargingPower;
|
|
|
cur2 = chargingData_2->AvailableChargingCurrent;
|
|
|
vol = chargingData_2->MaximumChargingVoltage;
|
|
|
|
|
|
GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
|
|
|
- GetMaxPowerMethod(&pow2);
|
|
|
+ GetMaxPowerMethod(chargingData_2->Index, &pow2);
|
|
|
|
|
|
if (_pow_1 != pow1 ||
|
|
|
_cur_1 != cur1 ||
|
|
@@ -3004,12 +3004,18 @@ void GetMaxVolAndCurMethod(byte index, float *vol, float *cur)
|
|
|
|
|
|
if (maxChargingCur[index] != 0 && maxChargingCur[index] <= *cur)
|
|
|
*cur = maxChargingCur[index];
|
|
|
+
|
|
|
+ if (_chargingData[index]->ChargingProfileCurrent != 0 && _chargingData[index]->ChargingProfileCurrent <= *cur)
|
|
|
+ *cur = _chargingData[index]->ChargingProfileCurrent;
|
|
|
}
|
|
|
|
|
|
-void GetMaxPowerMethod(float *pow)
|
|
|
+void GetMaxPowerMethod(byte index, float *pow)
|
|
|
{
|
|
|
if (maxChargingPow != 0 && maxChargingPow <= *pow)
|
|
|
*pow = maxChargingPow;
|
|
|
+
|
|
|
+ if (_chargingData[index]->ChargingProfilePower != 0 && _chargingData[index]->ChargingProfilePower <= *pow)
|
|
|
+ *pow = _chargingData[index]->ChargingProfilePower;
|
|
|
}
|
|
|
|
|
|
time_t GetRtcInfoForEpoch()
|