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) ptr = (fb_data*)&lcd_framebuffer[y][x]; + + height = ymax - y - 1; /* fix height */ + do { lcd_write_data(ptr, width); ptr += LCD_WIDTH; } - while (++y <= ymax); + while (--height > 0); lcd_busy = false; } /* 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) ptr = &lcd_framebuffer[y][x]; + height = ymax - y - 1; /* fix height */ do { lcd_write_data(ptr, width); ptr += LCD_WIDTH; } - while (++y <= ymax); + while (--height > 0); lcd_busy = false; }