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
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h
index 850a2e8..3156b87 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 538c75d..48dc3f5 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 5b20300..8d719ec 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 @@
{
short x,y;
-#ifdef SCREEN_ROTATE /* portait */
+#if CONFIG_ORIENTATION == SCREEN_PORTAIT
x=val_x;
y=val_y;
#else
@@ -93,13 +93,13 @@
/* 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 1086c1c..1cd5939 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 @@
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 @@
{
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