From af395f4db6ad7b83f9d9afefb1c0ceeedd140a45 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 26 Mar 2008 01:50:41 +0000 Subject: 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 --- firmware/drivers/audio/uda1380.c | 4 ++-- firmware/drivers/button.c | 4 ++-- firmware/drivers/rtc/rtc_pcf50606.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/audio/uda1380.c b/firmware/drivers/audio/uda1380.c index ce69ef6..f6a7c73 100644 --- a/firmware/drivers/audio/uda1380.c +++ b/firmware/drivers/audio/uda1380.c @@ -203,10 +203,10 @@ void audiohw_enable_output(bool enable) static void reset(void) { #ifdef IRIVER_H300_SERIES - int mask = set_irq_level(HIGHEST_IRQ_LEVEL); + int mask = disable_irq_save(); pcf50606_write(0x3b, 0x00); /* GPOOD2 high Z */ pcf50606_write(0x3b, 0x07); /* GPOOD2 low */ - set_irq_level(mask); + restore_irq(mask); #else /* RESET signal */ or_l(1<<29, &GPIO_OUT); diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index b9473be..d38306b 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -465,10 +465,10 @@ void button_set_flip(bool flip) if (flip != flipped) /* not the current setting */ { /* avoid race condition with the button_tick() */ - int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + int oldlevel = disable_irq_save(); lastbtn = button_flip(lastbtn); flipped = flip; - set_irq_level(oldlevel); + restore_irq(oldlevel); } } #endif /* HAVE_LCD_BITMAP */ diff --git a/firmware/drivers/rtc/rtc_pcf50606.c b/firmware/drivers/rtc/rtc_pcf50606.c index 25b0c70..9b4de44 100644 --- a/firmware/drivers/rtc/rtc_pcf50606.c +++ b/firmware/drivers/rtc/rtc_pcf50606.c @@ -30,21 +30,21 @@ void rtc_init(void) int rtc_read_datetime(unsigned char* buf) { int rc; - int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + int oldlevel = disable_irq_save(); rc = pcf50606_read_multiple(0x0a, buf, 7); - set_irq_level(oldlevel); + restore_irq(oldlevel); return rc; } int rtc_write_datetime(unsigned char* buf) { int rc; - int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); + int oldlevel = disable_irq_save(); rc = pcf50606_write_multiple(0x0a, buf, 7); - set_irq_level(oldlevel); + restore_irq(oldlevel); return rc; } -- cgit v1.1