Permalink
Browse files

Fix low battery shutdown tool

The real reason for the "battery de-sync" is a misconfig of MAX77620 low battery monitor.

So there's no real battery battery de-sync.

Thanks @natinusala and @perillamint for finding this
  • Loading branch information...
CTCaer committed Jul 1, 2018
1 parent 42d743d commit 9672650d1a35418b59e179363fa2e2803ffb2de1
Showing with 16 additions and 2 deletions.
  1. +16 −2 ipl/main.c
@@ -1214,7 +1214,8 @@ static void dump_emmc_selected(emmcPartType_t dumpType)
}

gfx_putc(&gfx_con, '\n');
gfx_printf(&gfx_con, "Time taken: %d seconds.\n", get_tmr_s() - timer);
timer = get_tmr_s() - timer;
gfx_printf(&gfx_con, "Time taken: %dm %ds.\n", timer / 60, timer % 60);
sdmmc_storage_end(&storage);
if (res && 1) //TODO: Replace with the config check.
gfx_printf(&gfx_con, "\n%kFinished and verified!%k\nPress any key...\n",0xFF96FF00, 0xFFCCCCCC);
@@ -1739,7 +1740,7 @@ void print_battery_info()
btn_wait();
} */

void fix_battery_desync()
/*void reset_pmic_fuel_gauge_charger_config()
{
int avgCurrent;
@@ -1785,6 +1786,18 @@ void fix_battery_desync()
sleep(500000);
btn_wait();
}
}*/

void fix_battery_desync()
{
gfx_clear_grey(&gfx_ctxt, 0x1B);
gfx_con_setpos(&gfx_con, 0, 0);

max77620_low_battery_monitor_config();

gfx_puts(&gfx_con, "\nDone!\n");

btn_wait();
}

void about()
@@ -1942,6 +1955,7 @@ ment_t ment_tools[] = {
MDEF_HANDLER("Fix SD files attributes", fix_sd_attr),
MDEF_HANDLER("Fix battery de-sync", fix_battery_desync),
//MDEF_HANDLER("Fix fuel gauge configuration", fix_fuel_gauge_configuration),
//MDEF_HANDLER("Reset all battery cfg", reset_pmic_fuel_gauge_charger_config),
MDEF_CHGLINE(),
MDEF_CAPTION("------ Dangerous -----", 0xFFFF0000),
MDEF_MENU("AutoRCM", &menu_autorcm),

0 comments on commit 9672650

Please sign in to comment.