Add ADC to I/O ports debug menu on H10. Fix battery level reading empty when starting up on H10. Calibrated battery for H10 20GB.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11036 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Barry Wardell 2006-09-23 17:47:54 +00:00
parent 193611367a
commit 5a79b4e015
6 changed files with 37 additions and 22 deletions

View file

@ -81,21 +81,12 @@ void adc_init(void)
/* Initialise */
ADC_INIT=0;
ADC_ADDR=0x130;
ADC_STATUS=0;
/* Enable Channels 1-4 */
ADC_ADDR |= 0x1000000;
ADC_ADDR |= 0x2000000;
ADC_ADDR |= 0x4000000;
ADC_ADDR |= 0x8000000;
/* Start? */
ADC_ADDR |= 0x20000000;
ADC_ADDR |= 0x80000000;
/* Wait 50ms for things to settle */
sleep(HZ/20);
/* Force a scan of all channels to get initial values */
adc_scan(ADC_BATTERY);
adc_scan(ADC_UNKNOWN_1);
adc_scan(ADC_UNKNOWN_2);
adc_scan(ADC_SCROLLPAD);
tick_add_task(adc_tick);
}