1
0
Fork 0
forked from len0rd/rockbox

Work-in-progress iriver iFP-7xx port by Tomasz Malesinski

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8342 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2006-01-12 00:35:50 +00:00
parent 8d13068421
commit d83e929f3f
52 changed files with 737 additions and 18 deletions

View file

@ -294,4 +294,38 @@ void adc_init(void)
}
#elif CONFIG_CPU == PNX0101
static unsigned short adcdata[NUM_ADC_CHANNELS];
unsigned short adc_read(int channel)
{
return adcdata[channel];
}
static void adc_tick(void)
{
if (ADCST & 0x10) {
adcdata[0] = ADCCH0 & 0x3ff;
adcdata[1] = ADCCH1 & 0x3ff;
adcdata[2] = ADCCH2 & 0x3ff;
adcdata[3] = ADCCH3 & 0x3ff;
adcdata[4] = ADCCH4 & 0x3ff;
ADCST = 0xa;
}
}
void adc_init(void)
{
ADCR24 = 0xaaaaa;
ADCR28 = 0;
ADCST = 2;
ADCST = 0xa;
while (!(ADCST & 0x10));
adc_tick();
tick_add_task(adc_tick);
}
#endif