summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-11-11 04:48:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-11-11 04:48:33 +0000
commit28dfb54eeb77b1c99972b3b5fa9f1d1fd97e04e4 (patch)
treeaf365e63cf329b5a04012d6c23fa7c112c39f56c
parent59a2862347873c2dfcc9cd47cc788dbfef27fcf8 (diff)
change the SCREEN_ROTATE define to be more meaningful, and set the mr500 orientation to landscape by default
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15567 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-mrobe500.h8
-rw-r--r--firmware/export/config.h15
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c6
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c4
4 files changed, 26 insertions, 7 deletions
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h
index 850a2e83a1..3156b87060 100644
--- a/firmware/export/config-mrobe500.h
+++ b/firmware/export/config-mrobe500.h
@@ -49,8 +49,12 @@
/* LCD dimensions */
#define CONFIG_LCD LCD_MROBE500
-#define SCREEN_ROTATE
-#if defined(SCREEN_ROTATE)
+
+/* choose the lcd orientation. both work */
+/* #define CONFIG_ORIENTATION SCREEN_PORTAIT */
+#define CONFIG_ORIENTATION SCREEN_LANDSCAPE
+
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
#define LCD_WIDTH 480
#define LCD_HEIGHT 640
#else
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 538c75d08a..48dc3f5693 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -118,6 +118,11 @@
#define RGB565 565
#define RGB565SWAPPED 3553
+/* CONFIG_ORIENTATION */
+#define SCREEN_PORTAIT 0
+#define SCREEN_LANDSCAPE 1
+#define SCREEN_SQUARE 2
+
/* CONFIG_I2C */
#define I2C_PLAYREC 1 /* Archos Player/Recorder style */
#define I2C_ONDIO 2 /* Ondio style */
@@ -251,6 +256,16 @@
#define CONFIG_RTC 0
#endif
+#ifndef CONFIG_ORIENTATION
+#if LCD_HEIGHT > LCD_WIDTH
+#define CONFIG_ORIENTATION SCREEN_PORTAIT
+#elif LCD_HEIGHT < LCD_WIDTH
+#define CONFIG_ORIENTATION SCREEN_LANDSCAPE
+#else
+#define CONFIG_ORIENTATION SCREEN_SQUARE
+#endif
+#endif
+
/* define this in the target config.h to use a different size */
#ifndef CONFIG_DEFAULT_ICON_HEIGHT
#define CONFIG_DEFAULT_ICON_HEIGHT 8
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
index 5b20300594..8d719eca81 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
@@ -66,7 +66,7 @@ static int touch_to_pixels(short val_x, short val_y)
{
short x,y;
-#ifdef SCREEN_ROTATE /* portait */
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
x=val_x;
y=val_y;
#else
@@ -93,13 +93,13 @@ void button_init_device(void)
/* GIO is the power button, set as input */
IO_GIO_DIR0 |= 0x01;
-#ifdef SCREEN_ROTATE /* portait */
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
topleft.val_x = 200;
topleft.val_y = 3900;
bottomright.val_x = 3880;
bottomright.val_y = 270;
-#else /* landscape */
+#else
topleft.val_x = 270;
topleft.val_y = 200;
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 1086c1c28b..1cd59397a6 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -100,7 +100,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if (height <= 0)
return; /* nothing left to do */
-#if defined(SCREEN_ROTATE)
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
dst = (fb_data *)FRAME + LCD_WIDTH*y + x;
src = &lcd_framebuffer[y][x];
@@ -149,7 +149,7 @@ void lcd_update(void)
{
if (!lcd_on)
return;
-#if defined(SCREEN_ROTATE)
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
lcd_copy_buffer_rect((fb_data *)FRAME, &lcd_framebuffer[0][0],
LCD_WIDTH*LCD_HEIGHT, 1);
#else