mirror of
https://github.com/CTCaer/hekate.git
synced 2024-11-22 01:46:39 +00:00
hekate: reinstate charger enable
Add back charger enable on boot, inside low battery check. It will be kept as is since there's the following case that addresses: OTG mode and shut off will not restore charger mode.
This commit is contained in:
parent
0aea402632
commit
6c601ccaa5
1 changed files with 5 additions and 3 deletions
|
@ -138,8 +138,7 @@ bool is_ipl_updated(void *buf, char *path, bool force)
|
|||
{
|
||||
FIL fp;
|
||||
reloc_meta_t *reloc = (reloc_meta_t *)(IPL_LOAD_ADDR + RELOC_META_OFF);
|
||||
boot_cfg_t *tmp_cfg = malloc(sizeof(boot_cfg_t));
|
||||
memset(tmp_cfg, 0, sizeof(boot_cfg_t));
|
||||
boot_cfg_t *tmp_cfg = zalloc(sizeof(boot_cfg_t));
|
||||
|
||||
f_open(&fp, path, FA_WRITE | FA_CREATE_ALWAYS);
|
||||
f_write(&fp, (u8 *)reloc->start, reloc->end - reloc->start, NULL);
|
||||
|
@ -1139,7 +1138,7 @@ static void _show_errors()
|
|||
|
||||
if (h_cfg.errors & ERR_L4T_KERNEL)
|
||||
{
|
||||
WPRINTF("Kernel panic occurred!\n");
|
||||
WPRINTF("L4T Kernel panic occurred!\n");
|
||||
if (!(h_cfg.errors & ERR_SD_BOOT_EN))
|
||||
{
|
||||
if (!sd_save_to_file((void *)PSTORE_ADDR, PSTORE_SZ, "L4T_panic.bin"))
|
||||
|
@ -1186,6 +1185,9 @@ static void _check_low_battery()
|
|||
int batt_volt = 0;
|
||||
int charge_status = 0;
|
||||
|
||||
// Enable charger in case it's disabled.
|
||||
bq24193_enable_charger();
|
||||
|
||||
bq24193_get_property(BQ24193_ChargeStatus, &charge_status);
|
||||
max17050_get_property(MAX17050_AvgVCELL, &batt_volt);
|
||||
|
||||
|
|
Loading…
Reference in a new issue