summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-24 16:01:53 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-24 16:01:53 +0000
commite4921d6ab5f7bf8999592faa0a9179bb40f11ebf (patch)
tree247d2780bdf1b78a482d22002a46f4dd9b8e1565 /firmware/target
parentc6a29640680fe3eef34754ff41a7a3ed6e3803b2 (diff)
downloadrockbox-e4921d6ab5f7bf8999592faa0a9179bb40f11ebf.tar.gz
rockbox-e4921d6ab5f7bf8999592faa0a9179bb40f11ebf.zip
Speed up lcd_update_rect by ~2.5% by counting towards 0 in the loop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23329 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c5
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index 7c3ccc2c0b..24fc4eae57 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -556,12 +556,15 @@ void lcd_update_rect(int x, int y, int width, int height)
556 556
557 ptr = (fb_data*)&lcd_framebuffer[y][x]; 557 ptr = (fb_data*)&lcd_framebuffer[y][x];
558 558
559
560 height = ymax - y - 1; /* fix height */
561
559 do 562 do
560 { 563 {
561 lcd_write_data(ptr, width); 564 lcd_write_data(ptr, width);
562 ptr += LCD_WIDTH; 565 ptr += LCD_WIDTH;
563 } 566 }
564 while (++y <= ymax); 567 while (--height > 0);
565 568
566 lcd_busy = false; 569 lcd_busy = false;
567} /* lcd_update_rect */ 570} /* lcd_update_rect */
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
index 21ecdf8afa..c22382f19c 100644
--- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
+++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c
@@ -405,12 +405,13 @@ void lcd_update_rect(int x, int y, int width, int height)
405 405
406 ptr = &lcd_framebuffer[y][x]; 406 ptr = &lcd_framebuffer[y][x];
407 407
408 height = ymax - y - 1; /* fix height */
408 do 409 do
409 { 410 {
410 lcd_write_data(ptr, width); 411 lcd_write_data(ptr, width);
411 ptr += LCD_WIDTH; 412 ptr += LCD_WIDTH;
412 } 413 }
413 while (++y <= ymax); 414 while (--height > 0);
414 lcd_busy = false; 415 lcd_busy = false;
415} 416}
416 417