diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2008-05-29 06:12:08 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2008-05-29 06:12:08 +0000 |
commit | 07bfba21aeba9bf3431bed6ca5daa377b0530a9b (patch) | |
tree | 4e9c7f8434d7bc82944952a7404b38ffe763b271 | |
parent | 5c5e8491962e7de20b74cc7ab61d65d52693de11 (diff) | |
download | rockbox-07bfba21aeba9bf3431bed6ca5daa377b0530a9b.tar.gz rockbox-07bfba21aeba9bf3431bed6ca5daa377b0530a9b.zip |
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
-rw-r--r-- | apps/debug_menu.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/ipod/adc-ipod-pcf.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/ipod/adc-target.h | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 22b1777a68..72c8225476 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1194,6 +1194,8 @@ bool dbg_ports(void) | |||
1194 | lcd_puts(0, line++, buf); | 1194 | lcd_puts(0, line++, buf); |
1195 | snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2); | 1195 | snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2); |
1196 | lcd_puts(0, line++, buf); | 1196 | lcd_puts(0, line++, buf); |
1197 | snprintf(buf, sizeof(buf), "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); | ||
1198 | lcd_puts(0, line++, buf); | ||
1197 | 1199 | ||
1198 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | 1200 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) |
1199 | line++; | 1201 | line++; |
diff --git a/firmware/target/arm/ipod/adc-ipod-pcf.c b/firmware/target/arm/ipod/adc-ipod-pcf.c index c0936251ad..0ca78caa94 100644 --- a/firmware/target/arm/ipod/adc-ipod-pcf.c +++ b/firmware/target/arm/ipod/adc-ipod-pcf.c | |||
@@ -83,5 +83,7 @@ void adc_init(void) | |||
83 | struct adc_struct *adc_battery = &adcdata[ADC_BATTERY]; | 83 | struct adc_struct *adc_battery = &adcdata[ADC_BATTERY]; |
84 | adc_battery->channelnum = 0x2; /* ADCVIN1, resistive divider */ | 84 | adc_battery->channelnum = 0x2; /* ADCVIN1, resistive divider */ |
85 | adc_battery->timeout = 0; | 85 | adc_battery->timeout = 0; |
86 | adcdata[ADC_ACCESSORY].channelnum = 4; | ||
87 | adcdata[ADC_ACCESSORY].timeout = 0; | ||
86 | _adc_read(adc_battery); | 88 | _adc_read(adc_battery); |
87 | } | 89 | } |
diff --git a/firmware/target/arm/ipod/adc-target.h b/firmware/target/arm/ipod/adc-target.h index 8458779b59..983dd4fbba 100644 --- a/firmware/target/arm/ipod/adc-target.h +++ b/firmware/target/arm/ipod/adc-target.h | |||
@@ -19,9 +19,10 @@ | |||
19 | #ifndef _ADC_TARGET_H_ | 19 | #ifndef _ADC_TARGET_H_ |
20 | #define _ADC_TARGET_H_ | 20 | #define _ADC_TARGET_H_ |
21 | 21 | ||
22 | #define NUM_ADC_CHANNELS 1 | 22 | #define NUM_ADC_CHANNELS 2 |
23 | 23 | ||
24 | #define ADC_BATTERY 0 | 24 | #define ADC_BATTERY 0 |
25 | #define ADC_ACCESSORY 1 | ||
25 | #define ADC_UNREG_POWER ADC_BATTERY | 26 | #define ADC_UNREG_POWER ADC_BATTERY |
26 | 27 | ||
27 | /* Force a scan now */ | 28 | /* Force a scan now */ |