mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
ascodec (sansas) add a 10 minute delay before re-enabling charge
Change-Id: I0b7bc3c92aeefa43f40becb26d7d9344d463775b
This commit is contained in:
parent
b77c973d1a
commit
0bb79dd847
1 changed files with 6 additions and 1 deletions
|
@ -105,6 +105,9 @@ static void disable_charger(void)
|
|||
/* Enable charger with specified settings. Start timers, etc. */
|
||||
static void enable_charger(void)
|
||||
{
|
||||
if (++ charger_total_timer < 0)
|
||||
return; /* wait to re-enable charging */
|
||||
|
||||
ascodec_write_charger(BATT_CHG_I | BATT_CHG_V);
|
||||
|
||||
sleep(HZ/10); /* Allow charger turn-on time (it could be gradual). */
|
||||
|
@ -131,6 +134,7 @@ void powermgmt_init_target(void)
|
|||
|
||||
static inline void charger_plugged(void)
|
||||
{
|
||||
charger_total_timer = 0;
|
||||
batt_threshold = BATT_FULL_VOLTAGE; /* Start with topped value. */
|
||||
battery_voltage_sync();
|
||||
}
|
||||
|
@ -171,7 +175,8 @@ static inline void charger_control(void)
|
|||
charge_state = CHARGE_STATE_ERROR;
|
||||
}
|
||||
/* else end of charge */
|
||||
|
||||
charger_total_timer = -(HZ * 600) / POWER_THREAD_STEP_TICKS;
|
||||
/* wait 10 minutes before re-enabling charging again */
|
||||
disable_charger();
|
||||
break;
|
||||
} /* CHARGING: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue