FS#1525 - Init values read by adc_read during adc_init

Attached to Project: Rockbox
Opened by Magnus Holmgren (learman) - Wednesday, 16 July 2003, 20:20 GMT
Last edited by Daniel Stenberg (bagder) - Thursday, 17 July 2003, 21:51 GMT
Task Type Patches
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


During adc_init, no analog to digital conversion is
done. Instead, a tick task is started to do the job.
This means it can take up to 8 ticks (80 ms) before a
call to adc_read returns a proper value.

But power_init needs proper adc_read values early on,
to initialize its power history. This patch adds an
initial ADC step in adc_init, so that adc_read will
return proper values when adc_init returns. If I've
read the hardware manual correctly, this takes about
100 µs to do (1/100 of a tick).

Note: this code is only tested on a player! However, I
see no reason why it shouldn't work on other models.
This task depends upon

Closed by  Daniel Stenberg (bagder)
Thursday, 17 July 2003, 21:51 GMT
Reason for closing:  Accepted
Comment by Jörg Hohensohn (hohensoh) - Wednesday, 16 July 2003, 21:08 GMT

Patch committed.
(I have no rights to close it)