My machine in some real rare cases (once a week or so) just stops
charging without any good reason. What helps here is replugging
the charger or writing to a chip charge register, so we do the later
indirectly every 20 minutes as a workaround.
There have been similar reports in the forums, where user leaves
the machine charging overnight and finds flat battery in the morning,
so hopefully this will help them too.
pnd_log ( pndn_debug, "---[ SIGALRM ]---\n" );
pnd_log ( pndn_debug, "---[ SIGALRM ]---\n" );
- static time_t last_charge_check;
+ static time_t last_charge_check, last_charge_worka;
int batlevel = pnd_device_get_battery_gauge_perc();
int uamps = 0;
time_t now;
int batlevel = pnd_device_get_battery_gauge_perc();
int uamps = 0;
time_t now;
pnd_log ( pndn_debug, "Charge start conditions reached, enabling charging\n" );
pnd_device_set_charger_enable ( bc_charge_device, 1 );
}
pnd_log ( pndn_debug, "Charge start conditions reached, enabling charging\n" );
pnd_device_set_charger_enable ( bc_charge_device, 1 );
}
+
+ // for some unknown reason it just stops charging randomly (happens once per week or so),
+ // and does not restart, resulting in a flat battery if machine is unattended.
+ // What seems to help here is writing to chip registers, we can do it here indirectly
+ // by writing to enable. Doing it occasionally should do no harm even with missing charger.
+ if ( batlevel <= bc_startcap && (unsigned int)(now - last_charge_worka) > 20*60 ) {
+ pnd_log ( pndn_debug, "Charge workaround trigger\n" );
+ pnd_device_set_charger_enable ( bc_charge_device, 1 );
+ last_charge_worka = now;
+ }
}
last_charge_check = now;
}
}
last_charge_check = now;
}