summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c2
-rw-r--r--firmware/target/arm/ipod/adc-ipod-pcf.c2
-rw-r--r--firmware/target/arm/ipod/adc-target.h3
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)
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2);
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)
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)
struct adc_struct *adc_battery = &adcdata[ADC_BATTERY];
adc_battery->channelnum = 0x2; /* ADCVIN1, resistive divider */
adc_battery->timeout = 0;
+ adcdata[ADC_ACCESSORY].channelnum = 4;
+ adcdata[ADC_ACCESSORY].timeout = 0;
_adc_read(adc_battery);
}
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 @@
#ifndef _ADC_TARGET_H_
#define _ADC_TARGET_H_
-#define NUM_ADC_CHANNELS 1
+#define NUM_ADC_CHANNELS 2
#define ADC_BATTERY 0
+#define ADC_ACCESSORY 1
#define ADC_UNREG_POWER ADC_BATTERY
/* Force a scan now */