dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Battery levels

Re: Battery levels

From: Uwe Freese <>
Date: Sun, 25 Aug 2002 21:06:40 +0200

Hello Magnus,

Magnus Holmgren wrote on Sunday, August 25, 2002, 12:48:54 PM:

MH> The battery levels in powermgmt.h, where they measured on a
MH> Recorder? The reason I'm asking is that on a player, the full
MH> charge voltage seems to be a bit higher...

The battery voltage depends on if you're charging, were charging some
minutes ago, the drive spins up etc. and additionally is not linear.
The actual output (in percent) is simple and good enough to have a
rough overview of how full the batteries are.

..but it could be better. With the voltages you have measured, one
could make is more accurately. I don't know if Heikki has planned this
by now (he's the author of powermgmt.c).

I would implement it like this:

- make an array (11 values) with the voltages of 0%, 10%... 100% when
  decharging (= AJB is playing) (according to your measurements)
- make an array (11 values) with the voltages of 0%, 10%... 100% when
  charging (= AJB is charging the batteries). These voltages are a
  little bit higher as the others, but not equally higher.
- make battery_level() search in one of these arrays for the best matching
  value and interpolate linear between the two around it

Heikki: If I shall implement it, let me know! I really would like it
to do, but don't want to write code that you won't commit later.

Bye, Uwe.
Received on 2002-08-25

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy