|
@@ -306,7 +306,7 @@ static u8 shark_battery_switch_single(void)
|
|
|
|
|
|
|
|
static shark_bool shark_battery_series_enabled(void)
|
|
static shark_bool shark_battery_series_enabled(void)
|
|
|
{
|
|
{
|
|
|
- if (shark_charger_detected) {
|
|
|
|
|
|
|
+ if (shark_charger_state != SHARK_CHG_REMOVE) {
|
|
|
return shark_false;
|
|
return shark_false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -356,7 +356,7 @@ static shark_bool shark_battery_check_series(u8 operate)
|
|
|
|
|
|
|
|
static shark_bool shark_battery_parrallel_enabled(void)
|
|
static shark_bool shark_battery_parrallel_enabled(void)
|
|
|
{
|
|
{
|
|
|
- return shark_charger_detected;
|
|
|
|
|
|
|
+ return shark_charger_state == SHARK_CHG_INSERT;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static shark_bool shark_battery_check_parrallel(u8 operate)
|
|
static shark_bool shark_battery_check_parrallel(u8 operate)
|
|
@@ -403,7 +403,7 @@ static u8 shark_battery_switch_auto(u8 operate)
|
|
|
return operate;
|
|
return operate;
|
|
|
} else if (shark_battery_check_parrallel(operate)) {
|
|
} else if (shark_battery_check_parrallel(operate)) {
|
|
|
return shark_battery_switch_parrallel();
|
|
return shark_battery_switch_parrallel();
|
|
|
- } else if (shark_charger_detected) {
|
|
|
|
|
|
|
+ } else if (shark_charger_state == SHARK_CHG_INSERT) {
|
|
|
return shark_battery_switch_charge();
|
|
return shark_battery_switch_charge();
|
|
|
} else {
|
|
} else {
|
|
|
return shark_battery_switch_single();
|
|
return shark_battery_switch_single();
|
|
@@ -431,7 +431,7 @@ int8_t Battery_CB_Switch(uint8_t cb_operate)
|
|
|
|
|
|
|
|
println("switch: %d", cb_operate_state);
|
|
println("switch: %d", cb_operate_state);
|
|
|
|
|
|
|
|
- if (shark_charger_detected) {
|
|
|
|
|
|
|
+ if (shark_charger_state == SHARK_CHG_INSERT) {
|
|
|
shark_charger_set_enable(shark_true);
|
|
shark_charger_set_enable(shark_true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1179,7 +1179,7 @@ uint8_t Check_CB_BAT1_BAT2_SERIES(void)
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- if (shark_charger_detected)
|
|
|
|
|
|
|
+ if (shark_charger_state != SHARK_CHG_REMOVE)
|
|
|
{
|
|
{
|
|
|
temp_op = Select_One_BAT();
|
|
temp_op = Select_One_BAT();
|
|
|
return temp_op;
|
|
return temp_op;
|
|
@@ -1491,7 +1491,7 @@ void Intelligent_Management_Battery(void)
|
|
|
{
|
|
{
|
|
|
if(is_intelligent)
|
|
if(is_intelligent)
|
|
|
{
|
|
{
|
|
|
- if(shark_charger_detected)
|
|
|
|
|
|
|
+ if(shark_charger_state != SHARK_CHG_REMOVE)
|
|
|
{
|
|
{
|
|
|
if (shark_charge_times < SHARK_CHG_TIME_SWITCH) {
|
|
if (shark_charge_times < SHARK_CHG_TIME_SWITCH) {
|
|
|
return;
|
|
return;
|