summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-03-02 11:32:59 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-03-02 11:32:59 +0000
commit111a972b65f5fcc2ef98a5164d0367e7e50f4b09 (patch)
tree84cdb473f8c439575ac99d90f94d636e7f25e731 /firmware/drivers
parentaa5b23d6162a5ac6cbfc1d871ed9360ffa946c56 (diff)
downloadrockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.tar.gz
rockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.zip
Made set_irq_level() an inline function, and optimized it by removing the bit shifts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4330 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/button.c5
-rw-r--r--firmware/drivers/power.c2
-rw-r--r--firmware/drivers/serial.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 66c7e978fb..cbb6d58f7b 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -30,6 +30,7 @@
30#include "adc.h" 30#include "adc.h"
31#include "serial.h" 31#include "serial.h"
32#include "power.h" 32#include "power.h"
33#include "system.h"
33 34
34struct event_queue button_queue; 35struct event_queue button_queue;
35 36
@@ -256,10 +257,10 @@ static int button_flip(int button)
256 */ 257 */
257void button_set_flip(bool flip) 258void button_set_flip(bool flip)
258{ 259{
259 if (flip != flipped) /* not the curent setting */ 260 if (flip != flipped) /* not the current setting */
260 { 261 {
261 /* avoid race condition with the button_tick() */ 262 /* avoid race condition with the button_tick() */
262 int oldlevel = set_irq_level(15); 263 int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
263 lastbtn = button_flip(lastbtn); 264 lastbtn = button_flip(lastbtn);
264 flipped = flip; 265 flipped = flip;
265 set_irq_level(oldlevel); 266 set_irq_level(oldlevel);
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 563ff3e25c..621f53e11e 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -118,7 +118,7 @@ bool ide_powered(void)
118 118
119void power_off(void) 119void power_off(void)
120{ 120{
121 set_irq_level(15); 121 set_irq_level(HIGHEST_IRQ_LEVEL);
122#ifdef HAVE_POWEROFF_ON_PBDR 122#ifdef HAVE_POWEROFF_ON_PBDR
123 and_b(~0x10, &PBDRL); 123 and_b(~0x10, &PBDRL);
124 or_b(0x10, &PBIORL); 124 or_b(0x10, &PBIORL);
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index 5aae38e58c..2badf2e39f 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -172,7 +172,7 @@ static void screen_dump(void)
172 172
173 serial_enable_tx(); 173 serial_enable_tx();
174 174
175 level = set_irq_level(15); 175 level = set_irq_level(HIGHEST_IRQ_LEVEL);
176 for(y = 0;y < LCD_HEIGHT/8;y++) 176 for(y = 0;y < LCD_HEIGHT/8;y++)
177 { 177 {
178 for(x = 0;x < LCD_WIDTH;x++) 178 for(x = 0;x < LCD_WIDTH;x++)