From 111a972b65f5fcc2ef98a5164d0367e7e50f4b09 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 2 Mar 2004 11:32:59 +0000 Subject: 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 --- firmware/drivers/button.c | 5 +++-- firmware/drivers/power.c | 2 +- firmware/drivers/serial.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'firmware/drivers') 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 @@ #include "adc.h" #include "serial.h" #include "power.h" +#include "system.h" struct event_queue button_queue; @@ -256,10 +257,10 @@ static int button_flip(int button) */ void button_set_flip(bool flip) { - if (flip != flipped) /* not the curent setting */ + if (flip != flipped) /* not the current setting */ { /* avoid race condition with the button_tick() */ - int oldlevel = set_irq_level(15); + int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); lastbtn = button_flip(lastbtn); flipped = flip; 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) void power_off(void) { - set_irq_level(15); + set_irq_level(HIGHEST_IRQ_LEVEL); #ifdef HAVE_POWEROFF_ON_PBDR and_b(~0x10, &PBDRL); 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) serial_enable_tx(); - level = set_irq_level(15); + level = set_irq_level(HIGHEST_IRQ_LEVEL); for(y = 0;y < LCD_HEIGHT/8;y++) { for(x = 0;x < LCD_WIDTH;x++) -- cgit v1.2.3