summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index 8cff7bda21..0b62666c81 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -32,9 +32,6 @@
32#include "system.h" 32#include "system.h"
33#include "hwcompat.h" 33#include "hwcompat.h"
34 34
35/*** macros ***/
36#define SWAP_INT(X,Y) {int tmp=X; X=Y; Y=tmp;}
37
38/* LCD command codes for HD66789R */ 35/* LCD command codes for HD66789R */
39#define LCD_CNTL_RAM_ADDR_SET 0x21 36#define LCD_CNTL_RAM_ADDR_SET 0x21
40#define LCD_CNTL_WRITE_TO_GRAM 0x22 37#define LCD_CNTL_WRITE_TO_GRAM 0x22
@@ -136,9 +133,9 @@ static void lcd_setup_drawing_region(int x, int y, int width, int height)
136 x1 = (y + height) - 1; /* max vert */ 133 x1 = (y + height) - 1; /* max vert */
137#elif CONFIG_LCD == LCD_IPODCOLOR 134#elif CONFIG_LCD == LCD_IPODCOLOR
138 y0 = y; /* start vert */ 135 y0 = y; /* start vert */
139 x0 = (LCD_WIDTH - 1) - x; /* start horiz */ 136 x0 = LCD_WIDTH - (x + width); /* start horiz */
140 y1 = (y + height) - 1; /* end vert */ 137 y1 = (y + height) - 1; /* end vert */
141 x1 = (x0 - width) + 1; /* end horiz */ 138 x1 = (x0 + width) - 1; /* end horiz */
142#endif 139#endif
143 140
144 /* setup the drawing region */ 141 /* setup the drawing region */
@@ -148,9 +145,6 @@ static void lcd_setup_drawing_region(int x, int y, int width, int height)
148 lcd_cmd_data(0x15, y1); /* end vert */ 145 lcd_cmd_data(0x15, y1); /* end vert */
149 lcd_cmd_data(0x16, x1); /* end horiz */ 146 lcd_cmd_data(0x16, x1); /* end horiz */
150 } else { 147 } else {
151 if (y1 < y0) SWAP_INT(y0,y1) /* swap max horiz < start horiz */
152 if (x1 < x0) SWAP_INT(x0,x1) /* swap max vert < start vert */
153
154 /* max horiz << 8 | start horiz */ 148 /* max horiz << 8 | start horiz */
155 lcd_cmd_data(LCD_CNTL_HORIZ_RAM_ADDR_POS, (y1 << 8) | y0); 149 lcd_cmd_data(LCD_CNTL_HORIZ_RAM_ADDR_POS, (y1 << 8) | y0);
156 /* max vert << 8 | start vert */ 150 /* max vert << 8 | start vert */