summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/menus/display_menu.c10
-rw-r--r--apps/plugins/lib/pluginlib_actions.c9
-rw-r--r--apps/plugins/logo.c12
-rw-r--r--apps/plugins/stats.c1
-rw-r--r--apps/settings.c4
-rw-r--r--firmware/export/config-mrobe500.h12
-rw-r--r--firmware/export/config.h1
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c18
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c287
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h45
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c1
-rw-r--r--firmware/target/arm/tms320dm320/uart-dm320.c2
-rwxr-xr-xtools/configure2
13 files changed, 387 insertions, 17 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index 60ed71cbd0..e5baf8ac1e 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -182,9 +182,11 @@ MENUITEM_SETTING(remote_contrast,
&global_settings.remote_contrast, NULL);
MENUITEM_SETTING(remote_invert,
&global_settings.remote_invert, NULL);
-
+
+#ifdef HAVE_LCD_FLIP
MENUITEM_SETTING(remote_flip_display,
&global_settings.remote_flip_display, flipdisplay_callback);
+#endif
#ifdef HAVE_REMOTE_LCD_TICKING
static int ticking_callback(int action,const struct menu_item_ex *this_item)
@@ -212,7 +214,11 @@ MAKE_MENU(lcd_remote_settings, ID2P(LANG_LCD_REMOTE_MENU),
&remote_backlight_on_button_hold,
#endif
&remote_caption_backlight, &remote_bl_filter_first_keypress,
- &remote_contrast, &remote_invert, &remote_flip_display
+ &remote_contrast, &remote_invert
+
+#ifdef HAVE_LCD_FLIP
+ ,&remote_flip_display
+#endif
#ifdef HAVE_REMOTE_LCD_TICKING
,&remote_reduce_ticking
#endif
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index 773b1032bd..18c6851827 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -59,6 +59,15 @@ const struct button_mapping remote_directions[] =
{ PLA_DOWN_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
{ PLA_LEFT_REPEAT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE},
{ PLA_RIGHT_REPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+#elif (CONFIG_REMOTE_KEYPAD == MROBE_REMOTE)
+ { PLA_UP, BUTTON_RC_PLAY, BUTTON_NONE},
+ { PLA_DOWN, BUTTON_RC_DOWN, BUTTON_NONE},
+ { PLA_LEFT, BUTTON_RC_REW, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RC_FF, BUTTON_NONE},
+ { PLA_UP_REPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_DOWN_REPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
#else
#error pluginlib_actions: Unsupported remote keypad
#endif
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index 2ec1b38271..e61de014cc 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -122,10 +122,6 @@ const unsigned char rockbox16x7[] = {
#elif CONFIG_KEYPAD == MROBE500_PAD
#define LP_QUIT BUTTON_POWER
-#define LP_DEC_X BUTTON_LEFT
-#define LP_INC_X BUTTON_RIGHT
-#define LP_DEC_Y BUTTON_RC_DOWN
-#define LP_INC_Y BUTTON_RC_PLAY
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
#define LP_QUIT BUTTON_BACK
@@ -191,7 +187,15 @@ const unsigned char rockbox16x7[] = {
#define LP_R_INC_X BUTTON_RC_FF
#define LP_R_DEC_Y BUTTON_RC_SOURCE
#define LP_R_INC_Y BUTTON_RC_BITRATE
+
+#elif (CONFIG_REMOTE_KEYPAD==MROBE_REMOTE)
+#define LP_R_QUIT BUTTON_RC_HEART
+#define LP_R_DEC_X BUTTON_RC_REW
+#define LP_R_INC_X BUTTON_RC_FF
+#define LP_R_DEC_Y BUTTON_RC_DOWN
+#define LP_R_INC_Y BUTTON_RC_PLAY
#endif
+
#endif /* CONFIG_REMOTE_KEYPAD */
#ifdef HAVE_TOUCHSCREEN
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 659f3e6763..976fd262f8 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -68,6 +68,7 @@ static bool abort;
#elif CONFIG_KEYPAD == MROBE500_PAD
#define STATS_STOP BUTTON_POWER
+#define STATS_STOP_REMOTE BUTTON_RC_DOWN
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
#define STATS_STOP BUTTON_BACK
diff --git a/apps/settings.c b/apps/settings.c
index 4db4f4405c..598e39e7ab 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -742,7 +742,11 @@ void settings_apply(bool read_disk)
#ifdef HAVE_REMOTE_LCD
lcd_remote_set_contrast(global_settings.remote_contrast);
lcd_remote_set_invert_display(global_settings.remote_invert);
+
+#ifdef HAVE_LCD_FLIP
lcd_remote_set_flip(global_settings.remote_flip_display);
+#endif
+
lcd_remote_scroll_speed(global_settings.remote_scroll_speed);
lcd_remote_scroll_step(global_settings.remote_scroll_step);
lcd_remote_scroll_delay(global_settings.remote_scroll_delay);
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h
index 939f09cb89..4010b036d1 100644
--- a/firmware/export/config-mrobe500.h
+++ b/firmware/export/config-mrobe500.h
@@ -89,13 +89,21 @@
#define HAVE_LCD_SLEEP
/* remote LCD */
-//#define HAVE_REMOTE_LCD
+#define HAVE_REMOTE_LCD
#define LCD_REMOTE_WIDTH 79
-#define LCD_REMOTE_HEIGHT 16
+#define LCD_REMOTE_HEIGHT 64
#define LCD_REMOTE_DEPTH 1
+/* Remote display colours, for screenshots and sim (0xRRGGBB) */
+#define LCD_REMOTE_DARKCOLOR 0x000000
+#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a
+#define LCD_REMOTE_BL_DARKCOLOR 0x000000
+#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa
+
#define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING
+#define CONFIG_REMOTE_KEYPAD MROBE_REMOTE
+
#define MIN_REMOTE_CONTRAST_SETTING 0
#define MAX_REMOTE_CONTRAST_SETTING 15
#define DEFAULT_REMOTE_CONTRAST_SETTING 7
diff --git a/firmware/export/config.h b/firmware/export/config.h
index ac60e9660e..17b3c1cdea 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -114,6 +114,7 @@
#define H100_REMOTE 1
#define H300_REMOTE 2
#define X5_REMOTE 3
+#define MROBE_REMOTE 4
/* CONFIG_BACKLIGHT_FADING */
/* No fading capabilities at all (yet) */
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
index 3e5be7c22f..bc163b1070 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
@@ -128,12 +128,6 @@ inline bool button_hold(void)
return false;
}
-static void remote_heartbeat(void)
-{
- char data[5] = {0x11, 0x30, 0x11^0x30, 0x11+0x30, '\0'};
- uart1_puts(data, 5);
-}
-
#define TOUCH_MARGIN 8
char r_buffer[5];
int r_button = BUTTON_NONE;
@@ -142,13 +136,14 @@ int button_read_device(int *data)
int retval, calbuf;
static int oldbutton = BUTTON_NONE;
+ static long last_touch = 0;
+
r_button=BUTTON_NONE;
*data = 0;
if (touch_available)
{
short x,y;
- static long last_touch = 0;
bool send_touch = false;
tsc2100_read_values(&x, &y, &last_z1, &last_z2);
if (TIME_BEFORE(last_touch + HZ/5, current_tick))
@@ -175,7 +170,14 @@ int button_read_device(int *data)
last_touch = current_tick;
touch_available = false;
}
- remote_heartbeat();
+ else
+ {
+ /* Touch hasn't happened in a while, clear the bits */
+ if(last_touch+3>current_tick)
+ {
+ oldbutton&=(0xFF);
+ }
+ }
if ((IO_GIO_BITSET0&0x01) == 0)
{
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
new file mode 100644
index 0000000000..5cdc00ce6a
--- /dev/null
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
@@ -0,0 +1,287 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: $
+ *
+ * Copyright (C) 2009 Karl Kurbjun
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include "config.h"
+#include "system.h"
+#include "file.h"
+#include "lcd-remote.h"
+#include "adc.h"
+#include "scroll_engine.h"
+#include "uart-target.h"
+
+static enum remote_control_states
+{
+ REMOTE_CONTROL_IDLE,
+ REMOTE_CONTROL_NOP,
+ REMOTE_CONTROL_POWER,
+ REMOTE_CONTROL_MASK,
+ REMOTE_CONTROL_DRAW1,
+ REMOTE_CONTROL_DRAW_PAUSE1,
+ REMOTE_CONTROL_DRAW2,
+ REMOTE_CONTROL_DRAW_PAUSE2,
+ REMOTE_CONTROL_SLEEP
+} remote_state_control = REMOTE_CONTROL_NOP;
+
+bool remote_initialized=true;
+
+unsigned char remote_contrast=DEFAULT_REMOTE_CONTRAST_SETTING;
+unsigned char remote_power=0x00;
+
+/*** hardware configuration ***/
+
+int lcd_remote_default_contrast(void)
+{
+ return DEFAULT_REMOTE_CONTRAST_SETTING;
+}
+
+void lcd_remote_sleep(void)
+{
+ remote_state_control=REMOTE_CONTROL_SLEEP;
+}
+
+void lcd_remote_powersave(bool on)
+{
+ if(on)
+ {
+ remote_power|=0xC0;
+ remote_state_control=REMOTE_CONTROL_POWER;
+ }
+ else
+ {
+ remote_power&=~(0xC0);
+ remote_state_control=REMOTE_CONTROL_POWER;
+ }
+}
+
+void lcd_remote_set_contrast(int val)
+{
+ remote_contrast=(char)val;
+ remote_state_control=REMOTE_CONTROL_POWER;
+}
+
+void lcd_remote_set_invert_display(bool yesno)
+{
+ (void)yesno;
+}
+
+/* turn the display upside down (call lcd_remote_update() afterwards) */
+void lcd_remote_set_flip(bool yesno)
+{
+ (void)yesno;
+}
+
+bool remote_detect(void)
+{
+ return true;
+}
+
+void lcd_remote_on(void)
+{
+ remote_power|=0x80;
+ remote_state_control=REMOTE_CONTROL_POWER;
+}
+
+void lcd_remote_off(void)
+{
+ remote_power&=~(0x80);
+ remote_state_control=REMOTE_CONTROL_POWER;
+}
+
+unsigned char lcd_remote_test[16]=
+ {0x80,0xFF,0x80,0x00,0xFF,0x89,0x89,0x00,0xC1,0x89,0x8F,0x80,0xFF,0x80,0,0};
+
+/* Monitor remote hotswap */
+static void remote_tick(void)
+{
+ unsigned char i;
+ unsigned char remote_payload[10], remote_payload_size;
+ unsigned char remote_check_xor, remote_check_sum;
+
+ switch (remote_state_control)
+ {
+ case REMOTE_CONTROL_IDLE:
+
+ remote_payload_size=0;
+ remote_state_control=REMOTE_CONTROL_IDLE;
+ break;
+ case REMOTE_CONTROL_NOP:
+ remote_payload[0]=0x11;
+ remote_payload[1]=0x30;
+
+ remote_payload_size=2;
+ remote_state_control=REMOTE_CONTROL_NOP;
+ break;
+ case REMOTE_CONTROL_POWER:
+ remote_payload[0]=0x31;
+ remote_payload[1]=remote_power;
+ remote_payload[2]=remote_contrast;
+
+ remote_payload_size=3;
+ remote_state_control=REMOTE_CONTROL_NOP;
+ break;
+ case REMOTE_CONTROL_MASK:
+ remote_payload[0]=0x41;
+ remote_payload[1]=0x94;
+
+ remote_payload_size=2;
+ remote_state_control=REMOTE_CONTROL_NOP;
+ break;
+ case REMOTE_CONTROL_DRAW1:
+ remote_payload[0]=0x51;
+ remote_payload[1]=0x80;
+ remote_payload[2]=14;
+ remote_payload[3]=0;
+ remote_payload[4]=0;
+ remote_payload[5]=14;
+ remote_payload[6]=8;
+
+ remote_payload_size=7;
+ remote_state_control=REMOTE_CONTROL_DRAW_PAUSE1;
+ break;
+ case REMOTE_CONTROL_DRAW_PAUSE1:
+ remote_payload[0]=0x11;
+ remote_payload[1]=0x30;
+
+ remote_payload_size=2;
+ remote_state_control=REMOTE_CONTROL_DRAW2;
+ break;
+ case REMOTE_CONTROL_DRAW2:
+ remote_payload[0]=0x51;
+ remote_payload[1]=0x80;
+ remote_payload[2]=14;
+ remote_payload[3]=0;
+ remote_payload[4]=8;
+ remote_payload[5]=14;
+ remote_payload[6]=16;
+
+ remote_payload_size=7;
+ remote_state_control=REMOTE_CONTROL_DRAW_PAUSE2;
+ break;
+ case REMOTE_CONTROL_DRAW_PAUSE2:
+ remote_payload[0]=0x11;
+ remote_payload[1]=0x30;
+
+ remote_payload_size=2;
+ remote_state_control=REMOTE_CONTROL_NOP;
+ break;
+ case REMOTE_CONTROL_SLEEP:
+ remote_payload[0]=0x71;
+ remote_payload[1]=0x30;
+
+ remote_payload_size=2;
+ remote_state_control=REMOTE_CONTROL_IDLE;
+ break;
+ default:
+ remote_payload_size=0;
+ break;
+ }
+
+ if(remote_payload_size==0)
+ {
+ return;
+ }
+
+ remote_check_xor=remote_payload[0];
+ remote_check_sum=remote_payload[0];
+ for(i=1; i<remote_payload_size; i++)
+ {
+ remote_check_xor^=remote_payload[i];
+ remote_check_sum+=remote_payload[i];
+ }
+
+ if(remote_payload[0]==0x51)
+ {
+ unsigned char offset;
+ unsigned char x;
+
+ if(remote_payload[4]==8)
+ {
+ offset=79;
+ }
+ else
+ {
+ offset=0;
+ }
+
+ for (x = 0; x < 14; x++)
+ {
+ remote_check_xor^=lcd_remote_test[x];
+ remote_check_sum+=lcd_remote_test[x];
+ }
+
+ uart1_puts(remote_payload, remote_payload_size);
+ lcd_remote_test[14]=remote_check_xor;
+ lcd_remote_test[15]=remote_check_sum;
+ uart1_puts(lcd_remote_test, 16);
+ }
+ else
+ {
+ remote_payload[remote_payload_size]=remote_check_xor;
+ remote_payload[remote_payload_size+1]=remote_check_sum;
+
+ uart1_puts(remote_payload, remote_payload_size+2);
+ }
+}
+
+void lcd_remote_init_device(void)
+{
+ lcd_remote_clear_display();
+ if (remote_detect())
+ lcd_remote_on();
+
+ /* put the remote control in the tick task */
+ tick_add_task(remote_tick);
+}
+
+/* Update the display.
+ This must be called after all other LCD functions that change the display. */
+void lcd_remote_update(void)
+{
+ if(remote_state_control!=REMOTE_CONTROL_DRAW1
+ && remote_state_control!=REMOTE_CONTROL_DRAW_PAUSE1
+ && remote_state_control!=REMOTE_CONTROL_DRAW2
+ && remote_state_control!=REMOTE_CONTROL_DRAW_PAUSE2)
+ {
+ remote_state_control=REMOTE_CONTROL_DRAW1;
+ }
+}
+
+/* Update a fraction of the display. */
+void lcd_remote_update_rect(int x, int y, int width, int height)
+{
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ lcd_remote_update();
+}
+
+void _remote_backlight_on(void)
+{
+ remote_power|=0x40;
+ remote_state_control=REMOTE_CONTROL_POWER;
+}
+
+void _remote_backlight_off(void)
+{
+ remote_power&=~(0x40);
+ remote_state_control=REMOTE_CONTROL_POWER;
+}
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h
new file mode 100644
index 0000000000..bf52e80238
--- /dev/null
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-target.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: $
+ *
+ * Copyright (C) 2009 by Karl Kurbjun
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef LCD_REMOTE_TARGET_H
+#define LCD_REMOTE_TARGET_H
+
+#define REMOTE_INIT_LCD 1
+#define REMOTE_DEINIT_LCD 2
+
+void lcd_remote_powersave(bool on);
+void lcd_remote_set_invert_display(bool yesno);
+//void lcd_remote_set_flip(bool yesno);
+
+bool remote_detect(void);
+void lcd_remote_init_device(void);
+void lcd_remote_on(void);
+void lcd_remote_off(void);
+void lcd_remote_update(void);
+void lcd_remote_update_rect(int, int, int, int);
+
+void _remote_backlight_on(void);
+void _remote_backlight_off(void);
+
+extern bool remote_initialized;
+
+void lcd_remote_sleep(void);
+
+#endif
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
index 9fd976ec10..777856dcfc 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/power-mr500.c
@@ -72,6 +72,7 @@ void power_off(void)
{
/* turn off backlight and wait for 1 second */
_backlight_off();
+ lcd_remote_sleep();
lcd_sleep();
sleep(HZ);
/* Hard shutdown */
diff --git a/firmware/target/arm/tms320dm320/uart-dm320.c b/firmware/target/arm/tms320dm320/uart-dm320.c
index 81076e81f2..5e2ad5e2be 100644
--- a/firmware/target/arm/tms320dm320/uart-dm320.c
+++ b/firmware/target/arm/tms320dm320/uart-dm320.c
@@ -123,7 +123,7 @@ void UART1(void)
panicf("UART1 buffer overflow");
else
{
- if(uart1_recieve_write==RECIEVE_RING_SIZE)
+ if(uart1_recieve_write>=RECIEVE_RING_SIZE)
uart1_recieve_write=0;
uart1_recieve_buffer_ring[uart1_recieve_write] = IO_UART1_DTRR & 0xff;
diff --git a/tools/configure b/tools/configure
index 905a777b58..44ae3e524f 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1459,6 +1459,8 @@ fi
tool="$rootdir/tools/scramble -add=m500"
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
+ bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0"
output="rockbox.mrobe500"
appextra="recorder:gui"
plugins="yes"