summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-12-15 02:04:18 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-12-15 02:04:18 +0000
commit50f63e334aa549f868b4b28c389b7ea34ffa9b4f (patch)
treee6f739c98d7d7d719ea4f01690997985c666a684 /firmware/drivers
parent56271b571abdff74672d174345ae3197e170953c (diff)
downloadrockbox-50f63e334aa549f868b4b28c389b7ea34ffa9b4f.tar.gz
rockbox-50f63e334aa549f868b4b28c389b7ea34ffa9b4f.zip
Fix for the LED problem in lcd_write_data(). The r0 register was not preserved for each loop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4144 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index aaa93b3385..f7fde506e3 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -82,7 +82,7 @@
82 * 82 *
83 */ 83 */
84 84
85void lcd_write(bool command, int byte) __attribute__ ((section (".icode"))); 85//void lcd_write(bool command, int byte) __attribute__ ((section (".icode")));
86void lcd_write(bool command, int byte) 86void lcd_write(bool command, int byte)
87{ 87{
88 asm("and.b %0, @(r0,gbr)" 88 asm("and.b %0, @(r0,gbr)"
@@ -191,6 +191,8 @@ void lcd_write_data(unsigned char* p_bytes, int count)
191 unsigned sda1; /* precalculated SC=low,SD=1 */ 191 unsigned sda1; /* precalculated SC=low,SD=1 */
192 unsigned clk0sda0; /* precalculated SC and SD low */ 192 unsigned clk0sda0; /* precalculated SC and SD low */
193 193
194 byte = *p_bytes++ << 24; /* fetch to MSB position */
195
194 cli(); /* make port modifications atomic */ 196 cli(); /* make port modifications atomic */
195 197
196 /* precalculate the values for later bit toggling, init data write */ 198 /* precalculate the values for later bit toggling, init data write */
@@ -211,8 +213,6 @@ void lcd_write_data(unsigned char* p_bytes, int count)
211 /* %5 */ "r"(~LCD_SD) 213 /* %5 */ "r"(~LCD_SD)
212 ); 214 );
213 215
214 byte = *p_bytes++ << 24; /* fetch to MSB position */
215
216 /* unrolled loop to serialize the byte */ 216 /* unrolled loop to serialize the byte */
217 asm ( 217 asm (
218 "mov %4,r0\n" /* we need &PBDRL in r0 for "or.b x,@(r0,gbr)" */ 218 "mov %4,r0\n" /* we need &PBDRL in r0 for "or.b x,@(r0,gbr)" */