summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
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/button.c
parentaa5b23d6162a5ac6cbfc1d871ed9360ffa946c56 (diff)
downloadrockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.zip
rockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.tar.gz
rockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.tar.bz2
rockbox-111a972b65f5fcc2ef98a5164d0367e7e50f4b09.tar.xz
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/button.c')
-rw-r--r--firmware/drivers/button.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 66c7e97..cbb6d58 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);