1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Linus Nielsen Feltzing 2003-12-15 02:04:18 +00:00
parent 56271b571a
commit 50f63e334a

View file

@ -82,7 +82,7 @@
*
*/
void lcd_write(bool command, int byte) __attribute__ ((section (".icode")));
//void lcd_write(bool command, int byte) __attribute__ ((section (".icode")));
void lcd_write(bool command, int byte)
{
asm("and.b %0, @(r0,gbr)"
@ -191,6 +191,8 @@ void lcd_write_data(unsigned char* p_bytes, int count)
unsigned sda1; /* precalculated SC=low,SD=1 */
unsigned clk0sda0; /* precalculated SC and SD low */
byte = *p_bytes++ << 24; /* fetch to MSB position */
cli(); /* make port modifications atomic */
/* precalculate the values for later bit toggling, init data write */
@ -211,8 +213,6 @@ void lcd_write_data(unsigned char* p_bytes, int count)
/* %5 */ "r"(~LCD_SD)
);
byte = *p_bytes++ << 24; /* fetch to MSB position */
/* unrolled loop to serialize the byte */
asm (
"mov %4,r0\n" /* we need &PBDRL in r0 for "or.b x,@(r0,gbr)" */