Ver código fonte

charge switch use voltage

Signed-off-by: FuangCao <cavan.cao@foxmail.com>
FuangCao 5 anos atrás
pai
commit
704abb6239
3 arquivos alterados com 4 adições e 14 exclusões
  1. 1 1
      Project/version.txt
  2. 2 12
      Source/app.c
  3. 1 1
      Source/sw_build_info.h

+ 1 - 1
Project/version.txt

@@ -1 +1 @@
-PS100XX_V11_11151644
+PS100XX_V11_11151805

+ 2 - 12
Source/app.c

@@ -245,8 +245,6 @@ static u8 shark_battery_switch_bat2(shark_battery_mask_t mask)
 
 static u8 shark_battery_switch_charge(void)
 {
-	u8 capacity1 = shark_battery_get_capacity1();
-	u8 capacity2 = shark_battery_get_capacity2();
 	u32 voltage1 = shark_battery_get_voltage1();
 	u32 voltage2 = shark_battery_get_voltage2();
 
@@ -258,14 +256,6 @@ static u8 shark_battery_switch_charge(void)
 		return shark_battery_switch_bat1(SHARK_BATT_MASK_BOTH);
 	}
 
-	if (capacity1 < capacity2) {
-		return shark_battery_switch_bat1(SHARK_BATT_MASK_BOTH);
-	}
-
-	if (capacity2 < capacity1) {
-		return shark_battery_switch_bat2(SHARK_BATT_MASK_BOTH);
-	}
-
 	if (voltage1 < voltage2) {
 		return shark_battery_switch_bat1(SHARK_BATT_MASK_BOTH);
 	} else {
@@ -1703,7 +1693,7 @@ void Intelligent_Management_Battery(void)
 			case CB_BAT1:
 				if(IS_CHARGER_ON())
 				{
-					if (shark_battery_charge_complete1() || shark_battery_get_capacity2() + SHARK_CHARGE_CAPACITY_DELTA < shark_battery_get_capacity1())
+					if (shark_battery_charge_complete1() || shark_battery_get_voltage2() < shark_battery_get_voltage1())
 					{
 						Battery_Change_Mode(CFG_BAT2);
 					}
@@ -1720,7 +1710,7 @@ void Intelligent_Management_Battery(void)
 			case CB_BAT2:
 				if(IS_CHARGER_ON())
 				{
-					if (shark_battery_charge_complete2() || shark_battery_get_capacity1() + SHARK_CHARGE_CAPACITY_DELTA < shark_battery_get_capacity2())
+					if (shark_battery_charge_complete2() || shark_battery_get_voltage1() < shark_battery_get_voltage2())
 					{
 						Battery_Change_Mode(CFG_BAT1);
 					}

+ 1 - 1
Source/sw_build_info.h

@@ -1,3 +1,3 @@
 #pragma once
 
-#define CONFIG_VERSION "PS100XX_V11_11151644"
+#define CONFIG_VERSION "PS100XX_V11_11151805"