summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ipod/adc-ipod.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/ipod/adc-ipod.c')
-rw-r--r--firmware/target/arm/ipod/adc-ipod.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/target/arm/ipod/adc-ipod.c b/firmware/target/arm/ipod/adc-ipod.c
index 493b98ef74..39463af30b 100644
--- a/firmware/target/arm/ipod/adc-ipod.c
+++ b/firmware/target/arm/ipod/adc-ipod.c
@@ -55,7 +55,7 @@ static unsigned short _adc_read(struct adc_struct *adc)
55 } 55 }
56 adc->data = value; 56 adc->data = value;
57 return value; 57 return value;
58 } else 58 } else
59#endif 59#endif
60 { 60 {
61 return adc->data; 61 return adc->data;
@@ -66,11 +66,19 @@ static unsigned short _adc_read(struct adc_struct *adc)
66unsigned short adc_scan(int channel) { 66unsigned short adc_scan(int channel) {
67 struct adc_struct *adc = &adcdata[channel]; 67 struct adc_struct *adc = &adcdata[channel];
68 adc->timeout = 0; 68 adc->timeout = 0;
69#ifdef IPOD_1G2G
70 if (channel == ADC_UNREG_POWER)
71 return 681; /* FIXME fake 4.00V */
72#endif
69 return _adc_read(adc); 73 return _adc_read(adc);
70} 74}
71 75
72/* Retrieve the ADC value, only does a scan periodically */ 76/* Retrieve the ADC value, only does a scan periodically */
73unsigned short adc_read(int channel) { 77unsigned short adc_read(int channel) {
78#ifdef IPOD_1G2G
79 if (channel == ADC_UNREG_POWER)
80 return 681; /* FIXME fake 4.00V */
81#endif
74 return _adc_read(&adcdata[channel]); 82 return _adc_read(&adcdata[channel]);
75} 83}
76 84