Add the ADC_ACCESSORY channel on the ipod, to allow for accessory detection once we figure that out.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17648 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2008-05-29 06:12:08 +00:00
parent 5c5e849196
commit 07bfba21ae
3 changed files with 6 additions and 1 deletions

View file

@ -1194,6 +1194,8 @@ bool dbg_ports(void)
lcd_puts(0, line++, buf); lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2); snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2);
lcd_puts(0, line++, buf); lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "ACCESSORY: %d", adc_read(ADC_ACCESSORY));
lcd_puts(0, line++, buf);
#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
line++; line++;

View file

@ -83,5 +83,7 @@ void adc_init(void)
struct adc_struct *adc_battery = &adcdata[ADC_BATTERY]; struct adc_struct *adc_battery = &adcdata[ADC_BATTERY];
adc_battery->channelnum = 0x2; /* ADCVIN1, resistive divider */ adc_battery->channelnum = 0x2; /* ADCVIN1, resistive divider */
adc_battery->timeout = 0; adc_battery->timeout = 0;
adcdata[ADC_ACCESSORY].channelnum = 4;
adcdata[ADC_ACCESSORY].timeout = 0;
_adc_read(adc_battery); _adc_read(adc_battery);
} }

View file

@ -19,9 +19,10 @@
#ifndef _ADC_TARGET_H_ #ifndef _ADC_TARGET_H_
#define _ADC_TARGET_H_ #define _ADC_TARGET_H_
#define NUM_ADC_CHANNELS 1 #define NUM_ADC_CHANNELS 2
#define ADC_BATTERY 0 #define ADC_BATTERY 0
#define ADC_ACCESSORY 1
#define ADC_UNREG_POWER ADC_BATTERY #define ADC_UNREG_POWER ADC_BATTERY
/* Force a scan now */ /* Force a scan now */