diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-03-26 01:50:41 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-03-26 01:50:41 +0000 |
commit | af395f4db6ad7b83f9d9afefb1c0ceeedd140a45 (patch) | |
tree | b631289b4a3b28d3c65b10d272d50298f377c69f /firmware/target/coldfire/iriver/h300/adc-h300.c | |
parent | 74d678fdbcbc427c057e7682ba0a0566e49a8b97 (diff) | |
download | rockbox-af395f4db6ad7b83f9d9afefb1c0ceeedd140a45.tar.gz rockbox-af395f4db6ad7b83f9d9afefb1c0ceeedd140a45.zip |
Do core interrupt masking in a less general fashion and save some instructions to decrease size and speed things up a little bit. Small fix to a few places where interrupts would get enabled again where they shouldn't have been (context switching calls when disabled).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16811 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/adc-h300.c')
-rw-r--r-- | firmware/target/coldfire/iriver/h300/adc-h300.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/target/coldfire/iriver/h300/adc-h300.c b/firmware/target/coldfire/iriver/h300/adc-h300.c index b13d0c73cc..efe5a9d746 100644 --- a/firmware/target/coldfire/iriver/h300/adc-h300.c +++ b/firmware/target/coldfire/iriver/h300/adc-h300.c | |||
@@ -34,7 +34,7 @@ static int adcc2_parms[] = | |||
34 | 34 | ||
35 | unsigned short adc_scan(int channel) | 35 | unsigned short adc_scan(int channel) |
36 | { | 36 | { |
37 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | 37 | int level = disable_irq_save(); |
38 | unsigned data; | 38 | unsigned data; |
39 | 39 | ||
40 | pcf50606_write(0x2f, adcc2_parms[channel]); | 40 | pcf50606_write(0x2f, adcc2_parms[channel]); |
@@ -43,6 +43,6 @@ unsigned short adc_scan(int channel) | |||
43 | if (channel == ADC_BATTERY) | 43 | if (channel == ADC_BATTERY) |
44 | data = (data << 2) | (pcf50606_read(0x31) & 0x03); | 44 | data = (data << 2) | (pcf50606_read(0x31) & 0x03); |
45 | 45 | ||
46 | set_irq_level(level); | 46 | restore_irq(level); |
47 | return data; | 47 | return data; |
48 | } | 48 | } |