FS#2462 - More AJR v1 recharging cleanup

Attached to Project: Rockbox
Opened by Jerry (vanbargw) - Wednesday, 09 March 2005, 03:03 GMT
Last edited by Jörg Hohensohn (hohensoh) - Wednesday, 23 March 2005, 20:54 GMT
Task Type Patches
Status Closed
Assigned To Jörg Hohensohn (hohensoh)
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Continuing to build on the last recharging patch [
1116884 ] "More aggressive Recorder V1 charging."

This patch does more consoladation and rearranging to
meet my asthetic expectations. I'm running out of deck
chairs to rearrange, however.

Also fixed is a bug introduced in the [ 1116884] patch
where I inadvertantly bypassed the "top-off" stage in
the recharge cycle, going from full charge to trickle.
Ooops, too much code reorganization.

I removed the battery percentage limitations of -1% per
minute (-3% per minute for USB). I don't know if this
is an acceptable removal or not -- I don't notice that
the battery percentage bounces around significantly,
but I don't watch it that closely either. My
presumption is that the better battery voltage
filtering of the [ 116884 ] patch makes the additional
rate limiting unnecessary.

I did some minor improvements to the debug log file
flushing: if the disk is active and there is stuff to
flush, I call fsync(). Otherwise, I only call fsync()
every 10 minutes. This is intended to minimize
extraneous disk accesses. I also fixed an error on
shutdown (fd > 0) vs (fd >= 0) which could have been
the cause of some of the empty log files.

This task depends upon

Closed by  Jörg Hohensohn (hohensoh)
Wednesday, 23 March 2005, 20:54 GMT
Reason for closing:  Accepted
Additional comments about closing:  Logged In: YES

The patch again didn't apply cleanly, but manually was OK.
Comment by Jörg Hohensohn (hohensoh) - Wednesday, 16 March 2005, 09:22 GMT

The patch doesn't apply cleanly to current cvs, but I'll se what
I can do.
Comment by Jörg Hohensohn (hohensoh) - Wednesday, 16 March 2005, 14:16 GMT

Hmm, I patched it manually, but am far from sure the result is
correct. E.g. I get compilation errors for the Ondio target.
Jerry, can you please check, and/or file your plain
powermgmt.c here? (It's safe to assume nobody else is
modifying it now.)
Comment by Jerry (vanbargw) - Monday, 21 March 2005, 02:06 GMT

Hi Jörg and other patchwatchers:

The New Improved[tm] 050320.patch (attached) applies and
compiles cleanly on the Player, AJR, AJRv2 and Ondio.

In addition to the previously mentioned bug fixes and
improvements, this adds a proportional term to the recharge
control loop (giving us PI of the traditional PID control
method). (Trivia: Adding a derivative term is not necessary.)

I rearranged the debug battery screens somewhat and changed
the information on them to display things like the P and I

Acting on Jens' tip that the Ondio "?" may be related to the
multiple battery type handling, I changed the set to -1 to a
call to battery_level_update() -- since I don't have an
Ondio, I cannot test this.

Please take this for a spin and send me feedback if you run
into problems (preferrably on the email list). This should
be "production ready": I don't plan to add any more features
or clean up to this patch unless there are problems.

Comment by Jörg Hohensohn (hohensoh) - Wednesday, 23 March 2005, 20:54 GMT

The patch again didn't apply cleanly, but manually was OK.