diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-10-29 13:49:43 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-10-29 13:49:43 +0000 |
commit | 9aa5be6c4c2ad5e455ea3f763ff886ac1350688f (patch) | |
tree | cf52ce3458a7ce58c03f13c68f06601f3c01c008 /firmware | |
parent | 85c9a05c56a290a0dd1686808d5bdb966d72f9a5 (diff) |
H300: Slight simplification of adc_scan(), ported from X5.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11384 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/adc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c index 9e6ed19e4b..646509b8a8 100644 --- a/firmware/drivers/adc.c +++ b/firmware/drivers/adc.c @@ -112,20 +112,20 @@ void adc_init(void) static unsigned char adcdata[NUM_ADC_CHANNELS]; #ifdef IRIVER_H300_SERIES -static int channelnum[] = +static int adcc2_parms[] = { - 5, /* ADC_BUTTONS (ADCIN2) */ - 6, /* ADC_REMOTE (ADCIN3) */ - 0, /* ADC_BATTERY (BATVOLT, resistive divider) */ - 2, /* ADC_REMOTEDETECT (ADCIN1, resistive divider) */ + [ADC_BUTTONS] = 0x80 | (5 << 1) | 1, /* ADCIN2 */ + [ADC_REMOTE] = 0x80 | (6 << 1) | 1, /* ADCIN3 */ + [ADC_BATTERY] = 0x80 | (0 << 1) | 1, /* BATVOLT, resistive divider */ + [ADC_REMOTEDETECT] = 0x80 | (2 << 1) | 1, /* ADCIN1, resistive divider */ }; unsigned short adc_scan(int channel) { int level = set_irq_level(HIGHEST_IRQ_LEVEL); unsigned char data; - - pcf50606_write(0x2f, 0x80 | (channelnum[channel] << 1) | 1); + + pcf50606_write(0x2f, adcc2_parms[channel]); data = pcf50606_read(0x30); adcdata[channel] = data; |