summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire/iriver
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-03-26 01:50:41 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-03-26 01:50:41 +0000
commitaf395f4db6ad7b83f9d9afefb1c0ceeedd140a45 (patch)
treeb631289b4a3b28d3c65b10d272d50298f377c69f /firmware/target/coldfire/iriver
parent74d678fdbcbc427c057e7682ba0a0566e49a8b97 (diff)
downloadrockbox-af395f4db6ad7b83f9d9afefb1c0ceeedd140a45.tar.gz
rockbox-af395f4db6ad7b83f9d9afefb1c0ceeedd140a45.tar.bz2
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')
-rw-r--r--firmware/target/coldfire/iriver/audio-iriver.c2
-rw-r--r--firmware/target/coldfire/iriver/h100/adc-h100.c4
-rw-r--r--firmware/target/coldfire/iriver/h100/power-h100.c3
-rw-r--r--firmware/target/coldfire/iriver/h100/spdif-h100.c2
-rw-r--r--firmware/target/coldfire/iriver/h300/adc-h300.c4
-rw-r--r--firmware/target/coldfire/iriver/h300/backlight-h300.c4
-rw-r--r--firmware/target/coldfire/iriver/h300/power-h300.c3
-rw-r--r--firmware/target/coldfire/iriver/lcd-remote-iriver.c4
8 files changed, 12 insertions, 14 deletions
diff --git a/firmware/target/coldfire/iriver/audio-iriver.c b/firmware/target/coldfire/iriver/audio-iriver.c
index 4d22e7c987..51917b1338 100644
--- a/firmware/target/coldfire/iriver/audio-iriver.c
+++ b/firmware/target/coldfire/iriver/audio-iriver.c
@@ -41,7 +41,7 @@ void audio_set_output_source(int source)
IIS2CONFIG = (IIS2CONFIG & ~(7 << 8)) | (txsrc_select[source+1] << 8);
- set_irq_level(level);
+ restore_irq(level);
} /* audio_set_output_source */
void audio_input_mux(int source, unsigned flags)
diff --git a/firmware/target/coldfire/iriver/h100/adc-h100.c b/firmware/target/coldfire/iriver/h100/adc-h100.c
index 40fcc8925d..7ea7618b09 100644
--- a/firmware/target/coldfire/iriver/h100/adc-h100.c
+++ b/firmware/target/coldfire/iriver/h100/adc-h100.c
@@ -47,7 +47,7 @@
unsigned short adc_scan(int channel)
{
- int level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ int level = disable_irq_save();
unsigned char data = 0;
int i;
@@ -97,7 +97,7 @@ unsigned short adc_scan(int channel)
CS_HI;
- set_irq_level(level);
+ restore_irq(level);
return data;
}
diff --git a/firmware/target/coldfire/iriver/h100/power-h100.c b/firmware/target/coldfire/iriver/h100/power-h100.c
index 5dc8618cc6..7ecf961842 100644
--- a/firmware/target/coldfire/iriver/h100/power-h100.c
+++ b/firmware/target/coldfire/iriver/h100/power-h100.c
@@ -115,8 +115,7 @@ void power_off(void)
set_irq_level(DISABLE_INTERRUPTS);
and_l(~0x00080000, &GPIO1_OUT);
asm("halt");
- while(1)
- yield();
+ while(1);
}
#endif /* SIMULATOR */
diff --git a/firmware/target/coldfire/iriver/h100/spdif-h100.c b/firmware/target/coldfire/iriver/h100/spdif-h100.c
index beede3fdce..380622422c 100644
--- a/firmware/target/coldfire/iriver/h100/spdif-h100.c
+++ b/firmware/target/coldfire/iriver/h100/spdif-h100.c
@@ -99,7 +99,7 @@ void spdif_set_output_source(int source, bool src_on)
PDOR3 = 0; /* A write to the FIFO kick-starts playback */
}
- set_irq_level(level);
+ restore_irq(level);
} /* spdif_set_output_source */
/* Return the last set S/PDIF audio source */
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[] =
unsigned short adc_scan(int channel)
{
- int level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ int level = disable_irq_save();
unsigned data;
pcf50606_write(0x2f, adcc2_parms[channel]);
@@ -43,6 +43,6 @@ unsigned short adc_scan(int channel)
if (channel == ADC_BATTERY)
data = (data << 2) | (pcf50606_read(0x31) & 0x03);
- set_irq_level(level);
+ restore_irq(level);
return data;
}
diff --git a/firmware/target/coldfire/iriver/h300/backlight-h300.c b/firmware/target/coldfire/iriver/h300/backlight-h300.c
index c0d441ad3f..f042ee5524 100644
--- a/firmware/target/coldfire/iriver/h300/backlight-h300.c
+++ b/firmware/target/coldfire/iriver/h300/backlight-h300.c
@@ -51,10 +51,10 @@ void _backlight_off(void)
void _backlight_set_brightness(int val)
{
/* disable IRQs while bitbanging */
- int old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ int old_irq_level = disable_irq_save();
pcf50606_write(0x35, (val << 1) | 0x01); /* 512Hz, Enable PWM */
/* enable IRQs again */
- set_irq_level(old_irq_level);
+ restore_irq(old_irq_level);
}
void _remote_backlight_on(void)
diff --git a/firmware/target/coldfire/iriver/h300/power-h300.c b/firmware/target/coldfire/iriver/h300/power-h300.c
index 21c723da8e..a06763e555 100644
--- a/firmware/target/coldfire/iriver/h300/power-h300.c
+++ b/firmware/target/coldfire/iriver/h300/power-h300.c
@@ -86,8 +86,7 @@ void power_off(void)
set_irq_level(DISABLE_INTERRUPTS);
and_l(~0x00080000, &GPIO1_OUT);
asm("halt");
- while(1)
- yield();
+ while(1);
}
#endif /* SIMULATOR */
diff --git a/firmware/target/coldfire/iriver/lcd-remote-iriver.c b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
index cab7cc4104..2fe5d6c3c1 100644
--- a/firmware/target/coldfire/iriver/lcd-remote-iriver.c
+++ b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
@@ -478,9 +478,9 @@ static void remote_tick(void)
if (!(countdown % 8))
{
/* Determine which type of remote it is */
- level = set_irq_level(HIGHEST_IRQ_LEVEL);
+ level = disable_irq_save();
val = adc_scan(ADC_REMOTEDETECT);
- set_irq_level(level);
+ restore_irq(level);
if (val < ADCVAL_H100_LCD_REMOTE_HOLD)
{