Skip to content

Commit 0de2335

Browse files
authored
Merge pull request #683 from FrameworkComputer/fwk.battery_customize
Add battery customize in charge_state.c
2 parents b8b7c68 + 007d939 commit 0de2335

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

common/charge_state.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,15 @@ static int get_desired_input_current(enum battery_present batt_present,
10051005
} else {
10061006
#ifdef CONFIG_USB_POWER_DELIVERY
10071007
return MIN(PD_MAX_CURRENT_MA, info->input_current_max);
1008+
#else
1009+
#ifdef CONFIG_CUSTOMIZED_DESIGN
1010+
int ilim = charge_manager_get_charger_current();
1011+
return ilim == CHARGE_CURRENT_UNINITIALIZED ?
1012+
CHARGE_CURRENT_UNINITIALIZED :
1013+
MAX(CONFIG_CHARGER_DEFAULT_CURRENT_LIMIT, ilim);
10081014
#else
10091015
return info->input_current_max;
1016+
#endif
10101017
#endif
10111018
}
10121019
}
@@ -1576,6 +1583,11 @@ void charger_task(void *u)
15761583

15771584
charger_get_params(&curr.chg);
15781585
battery_get_params(&curr.batt);
1586+
1587+
#ifdef CONFIG_CUSTOMIZED_DESIGN
1588+
battery_customize(&curr);
1589+
#endif
1590+
15791591
#ifdef CONFIG_OCPC
15801592
if (curr.ac)
15811593
ocpc_get_adcs(&curr.ocpc);

0 commit comments

Comments
 (0)