mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-19 21:17:38 -04:00
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:
parent
03b8708f9e
commit
bb2f15ca7d
4 changed files with 57 additions and 67 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue