From aa5b23d6162a5ac6cbfc1d871ed9360ffa946c56 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 2 Mar 2004 10:01:26 +0000 Subject: Removed the interrupt disabling in lcd_write_data() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4329 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index 950f8b5057..fa072ac3f5 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c @@ -195,9 +195,8 @@ void lcd_write_data(unsigned char* p_bytes, int count) byte = *p_bytes++ << 24; /* fetch to MSB position */ - /* make port modifications atomic, in case an IRQ uses PBDRL */ - /* (currently not the case, so this could be optimized away) */ - oldlevel = set_irq_level(15); + /* This code will fail if an interrupt changes the contents of PBDRL. + If so, we must disable the interrupt here. */ /* precalculate the values for later bit toggling, init data write */ asm ( @@ -287,7 +286,8 @@ void lcd_write_data(unsigned char* p_bytes, int count) : "r0" ); - set_irq_level(oldlevel); + /* This is the place to reenable the interrupts, if we have disabled + them. See above. */ } while (--count); /* tail loop is faster */ } @@ -306,9 +306,8 @@ void lcd_write_data(unsigned char* p_bytes, int count) the only carry add/sub which does not destroy a source register */ byte = ~(*p_bytes++ << 24); /* fetch to MSB position */ - /* make port modifications atomic, in case an IRQ uses PBDRL */ - /* (currently not the case, so this could be optimized away) */ - oldlevel = set_irq_level(15); + /* This code will fail if an interrupt changes the contents of PBDRL. + If so, we must disable the interrupt here. */ /* precalculate the values for later bit toggling, init data write */ asm ( @@ -390,7 +389,8 @@ void lcd_write_data(unsigned char* p_bytes, int count) "r0" ); - set_irq_level(oldlevel); + /* This is the place to reenable the interrupts, if we have disabled + them. See above. */ } while (--count); /* tail loop is faster */ } -- cgit v1.2.3