I have always been confused by themes that make use of %bl to show the battery percentage as there is a difference in the percentage when charging and unplugging the cable. I dug into the code and now understand it is because of the differing battery tables. In the case of an ipod6g they're stored in /firmware/target/arm/s5l8702/ipod6g/powermgmt-6g.c.
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
unsigned short percent_to_volt_discharge[11] =
{
3500, 3670, 3720, 3750, 3770, 3800, 3860, 3920, 3980, 4070, 4170
};
#if CONFIG_CHARGING
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
unsigned short percent_to_volt_charge[11] =
{
3700, 3820, 3900, 3950, 3990, 4030, 4070, 4120, 4170, 4190, 4200
};
#endif /* CONFIG_CHARGING */
If I'm not completely wrong then I think I now understand why a battery with a reading of 4.017 mV will show as 83% full when not charging and as 46% full when charging. It's because of the different tables being used in each scenario.
Can anyone explain to me why there are these different tables? Can I not just have Rockbox say the battery is at 83% full when charging as well?
Thanks