Finer grained irq masking, blocking for i2c, plus a mutex to prevent conflicting read/writes

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8922 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2006-03-05 22:14:53 +00:00
parent 03b8708f9e
commit bb2f15ca7d
4 changed files with 57 additions and 67 deletions

View file

@ -294,10 +294,7 @@ static struct adc_struct adcdata[NUM_ADC_CHANNELS];
static unsigned short adc_scan(struct adc_struct *adc)
{
/* Disable interrupts during the I2C transaction */
int old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
unsigned short data = pcf50605_a2d_read(adc->channelnum);
set_irq_level(old_irq_level);
/* This gives us a 13 bit value corresponding to 0-5.4 volts
* The range of the value is 13FB-17FA */
data = (data<<2)+0x13FB;