summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c6
-rw-r--r--apps/keymaps/keymap-mr100.c534
-rw-r--r--apps/plugins/lib/pluginlib_actions.c35
-rw-r--r--firmware/target/arm/olympus/mrobe-100/button-mr100.c564
-rw-r--r--firmware/target/arm/olympus/mrobe-100/button-target.h39
-rw-r--r--firmware/target/arm/system-pp502x.c8
-rw-r--r--uisimulator/sdl/button.c34
7 files changed, 886 insertions, 334 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index d1463c7353..8cd1fedf5b 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -987,10 +987,12 @@ static bool dbg_spdif(void)
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
# define DEBUG_CANCEL BUTTON_REC
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
- (CONFIG_KEYPAD == MROBE100_PAD)
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
# define DEBUG_CANCEL BUTTON_REW
+#elif (CONFIG_KEYPAD == MROBE100_PAD)
+# define DEBUG_CANCEL BUTTON_MENU
+
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
(CONFIG_KEYPAD == SANSA_C200_PAD)
# define DEBUG_CANCEL BUTTON_LEFT
diff --git a/apps/keymaps/keymap-mr100.c b/apps/keymaps/keymap-mr100.c
index 572f510fb9..2d6b616d5d 100644
--- a/apps/keymaps/keymap-mr100.c
+++ b/apps/keymaps/keymap-mr100.c
@@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/
* $Id$
*
- * Copyright (C) Barry Wardell 2006
+ * Copyright (C) 2008 Mark Arigo
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
@@ -17,331 +17,314 @@
*
****************************************************************************/
-/* Button Code Definitions for Olympus m:robe 100 target
- NOTE: COPIED FROM IRIVER H10, NEEDS ADAPTING TO MROBE 100 */
+/* Button Code Definitions for the Olympus m:robe 100 */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include "config.h"
#include "action.h"
#include "button.h"
#include "settings.h"
-/* {Action Code, Button code, Prereq button code } */
-
-/*
+/*
* The format of the list is as follows
- * { Action Code, Button code, Prereq button code }
+ * { Action Code, Button code, Prereq button code }
* if there's no need to check the previous button's value, use BUTTON_NONE
- * Insert LAST_ITEM_IN_LIST at the end of each mapping
+ * Insert LAST_ITEM_IN_LIST at the end of each mapping
*/
+
+/* CONTEXT_CUSTOM's used in this file...
+
+CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
+CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens
+ i.e where up/down is inc/dec
+ CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec
+
+*/
+
+
static const struct button_mapping button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_STD_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- /* TODO: this is a bit of a hack so that we can exit some debug screens
- * (audio, tagcache, dircache, hwinfo, stack, ports). They don't like it
- * when ACTION_STD_CANCEL has anything other than BUTTON_NONE for prereq.
- */
- { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- LAST_ITEM_IN_LIST
-}; /* button_context_standard */
+ { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_DISPLAY, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
-static const struct button_mapping remote_button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
+
+ { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+
+ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
LAST_ITEM_IN_LIST
-}; /* remote_button_context_standard */
+}; /* button_context_standard */
+
static const struct button_mapping button_context_wps[] = {
- { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT,BUTTON_PLAY },
- { ACTION_WPS_SKIPPREV, BUTTON_REW|BUTTON_REL, BUTTON_REW},
- { ACTION_WPS_SEEKBACK, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_REW|BUTTON_REL, BUTTON_REW|BUTTON_REPEAT },
- { ACTION_WPS_SKIPNEXT, BUTTON_FF|BUTTON_REL, BUTTON_FF },
- { ACTION_WPS_SEEKFWD, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_FF|BUTTON_REL, BUTTON_FF|BUTTON_REPEAT },
-
- { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_POWER|BUTTON_FF, BUTTON_POWER },
- { ACTION_WPS_ABSETA_PREVDIR, BUTTON_POWER|BUTTON_REW, BUTTON_POWER },
- { ACTION_WPS_ABRESET, BUTTON_POWER|BUTTON_PLAY, BUTTON_POWER },
-
- { ACTION_WPS_VOLDOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_WPS_VOLDOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_WPS_BROWSE, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_WPS_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_WPS_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_WPS_PITCHSCREEN, BUTTON_PLAY|BUTTON_LEFT, BUTTON_PLAY },
- { ACTION_WPS_ID3SCREEN, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_PLAY },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_wps */
+ { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
-static const struct button_mapping remote_button_context_wps[] = {
- { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT,BUTTON_RC_PLAY },
- { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW},
- { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
- { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
- { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
-
- { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_PITCHSCREEN, BUTTON_RC_PLAY|BUTTON_LEFT, BUTTON_RC_PLAY },
- { ACTION_WPS_ID3SCREEN, BUTTON_RC_PLAY|BUTTON_RIGHT, BUTTON_RC_PLAY },
-
- LAST_ITEM_IN_LIST
-}; /* remote_button_context_wps */
-
-static const struct button_mapping button_context_settings[] = {
- { ACTION_SETTINGS_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings */
+ { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
-static const struct button_mapping button_context_list[] = {
- { ACTION_LISTTREE_PGUP, BUTTON_REW|BUTTON_REL, BUTTON_REW },
- { ACTION_LISTTREE_PGDOWN, BUTTON_FF|BUTTON_REL, BUTTON_FF },
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_list */
+ { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+
+ { ACTION_WPS_BROWSE, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
+ { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_DISPLAY|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_WPS_ABSETA_PREVDIR,BUTTON_DISPLAY|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_WPS_ABRESET, BUTTON_DISPLAY|BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_WPS_PITCHSCREEN, BUTTON_DISPLAY|BUTTON_UP, BUTTON_DISPLAY },
+ { ACTION_WPS_PITCHSCREEN, BUTTON_DISPLAY|BUTTON_DOWN, BUTTON_DISPLAY },
+ { ACTION_WPS_ID3SCREEN, BUTTON_DISPLAY|BUTTON_MENU, BUTTON_NONE },
-static const struct button_mapping remote_button_context_list[] = {
- { ACTION_LISTTREE_PGUP, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
- { ACTION_LISTTREE_PGDOWN, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+ LAST_ITEM_IN_LIST
+}; /* button_context_wps */
+
+static const struct button_mapping button_context_list[] = {
+ { ACTION_LISTTREE_PGUP, BUTTON_DISPLAY|BUTTON_UP, BUTTON_DISPLAY },
+ { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_DISPLAY|BUTTON_UP },
+ { ACTION_LISTTREE_PGUP, BUTTON_DISPLAY|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DISPLAY|BUTTON_DOWN, BUTTON_DISPLAY },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DISPLAY|BUTTON_DOWN },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DISPLAY|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_list */
static const struct button_mapping button_context_tree[] = {
- { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_tree */
+ { ACTION_TREE_WPS, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
+ { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE },
-static const struct button_mapping remote_button_context_tree[] = {
- { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
- { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
}; /* button_context_tree */
-static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
- { ACTION_TREE_ROOT_INIT, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
- { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_without_combo */
+static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
+ { ACTION_NONE, BUTTON_DISPLAY, BUTTON_NONE },
+ { ACTION_TREE_PGLEFT, BUTTON_DISPLAY|BUTTON_LEFT, BUTTON_DISPLAY },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_DISPLAY|BUTTON_LEFT },
+ { ACTION_TREE_PGLEFT, BUTTON_DISPLAY|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL },
+ { ACTION_TREE_ROOT_INIT, BUTTON_DISPLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_DISPLAY|BUTTON_LEFT },
+ { ACTION_TREE_PGLEFT, BUTTON_DISPLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_DISPLAY|BUTTON_RIGHT, BUTTON_DISPLAY },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_DISPLAY|BUTTON_RIGHT },
+ { ACTION_TREE_PGRIGHT, BUTTON_DISPLAY|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL },
+ { ACTION_TREE_PGRIGHT, BUTTON_DISPLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-static const struct button_mapping remote_button_context_listtree_scroll_without_combo[] = {
- { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
- { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_without_combo */
+};
-static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
- { ACTION_LISTTREE_PGUP, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
- { ACTION_LISTTREE_PGDOWN, BUTTON_FF|BUTTON_REPEAT, BUTTON_FF },
- { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_PLAY, BUTTON_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_REL, BUTTON_REW|BUTTON_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_PLAY, BUTTON_REW|BUTTON_REL },
- { ACTION_TREE_ROOT_INIT, BUTTON_REW|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_REW|BUTTON_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_PLAY, BUTTON_PLAY },
- { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_REL, BUTTON_FF|BUTTON_PLAY },
- { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_PLAY, BUTTON_FF|BUTTON_REL },
- { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_with_combo */
-
-static const struct button_mapping remote_button_context_listtree_scroll_with_combo[] = {
- { ACTION_LISTTREE_PGUP, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
- { ACTION_LISTTREE_PGDOWN, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
- { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_RC_PLAY, BUTTON_RC_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_RC_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_RC_PLAY, BUTTON_RC_REW|BUTTON_REL },
- { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_REW|BUTTON_RC_PLAY },
- { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_RC_PLAY, BUTTON_RC_PLAY },
- { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_RC_PLAY },
- { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_RC_PLAY, BUTTON_RC_FF|BUTTON_REL },
- { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
+ { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_with_combo */
+};
+
+static const struct button_mapping button_context_settings[] = {
+ { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT,BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT,BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_RESET, BUTTON_DISPLAY, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_settings */
+
+static const struct button_mapping button_context_settings_right_is_inc[] = {
+ { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_RESET, BUTTON_DISPLAY, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_settingsgraphical */
static const struct button_mapping button_context_yesno[] = {
- { ACTION_YESNO_ACCEPT, BUTTON_RIGHT, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+ { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settings_yesno */
-static const struct button_mapping button_context_quickscreen[] = {
- { ACTION_QS_DOWNINV, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_QS_DOWNINV, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_REW, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_FF, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_quickscreen */
+static const struct button_mapping button_context_colorchooser[] = {
+ { ACTION_STD_OK, BUTTON_DISPLAY|BUTTON_REL, BUTTON_NONE },
-static const struct button_mapping remote_button_context_quickscreen[] = {
- { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP, BUTTON_NONE },
- { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_quickscreen */
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
+}; /* button_context_colorchooser */
-static const struct button_mapping button_context_settings_right_is_inc[] = {
- { ACTION_SETTINGS_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
- { ACTION_STD_PREV, BUTTON_REW, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_FF, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
+static const struct button_mapping button_context_eq[] = {
+ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_right_is_inc */
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
+}; /* button_context_eq */
+
+/** Bookmark Screen **/
+static const struct button_mapping button_context_bmark[] = {
+ { ACTION_BMS_DELETE, BUTTON_DISPLAY, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
+}; /* button_context_bmark */
+
+static const struct button_mapping button_context_time[] = {
+ { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_DISPLAY, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
+}; /* button_context_time */
+
+static const struct button_mapping button_context_quickscreen[] = {
+ { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_quickscreen */
static const struct button_mapping button_context_pitchscreen[] = {
- { ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_DEC_SMALL, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFT, BUTTON_REW, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_REW|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHT, BUTTON_FF, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_FF|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_TOGGLE_MODE, BUTTON_POWER, BUTTON_NONE },
- { ACTION_PS_RESET, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_LEFT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_pitchscreen */
-
-static const struct button_mapping remote_button_context_pitchscreen[] = {
- { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_RESET, BUTTON_RC_PLAY, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_pitchscreen */
+ { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
+ { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_TOGGLE_MODE, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_PS_RESET, BUTTON_DISPLAY, BUTTON_NONE },
+ { ACTION_PS_EXIT, BUTTON_MENU, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_pitchcreen */
static const struct button_mapping button_context_keyboard[] = {
- { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_SELECT, BUTTON_REW, BUTTON_NONE },
- { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_MORSE_INPUT, BUTTON_REW|BUTTON_PLAY, BUTTON_NONE },
- { ACTION_KBD_MORSE_SELECT, BUTTON_REW|BUTTON_REL, BUTTON_NONE },
+ { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_LEFT, BUTTON_DISPLAY|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_LEFT, BUTTON_DISPLAY|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_DISPLAY|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_DISPLAY|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_KBD_PAGE_FLIP, BUTTON_DISPLAY|BUTTON_MENU, BUTTON_NONE },
+ { ACTION_KBD_DONE, BUTTON_DISPLAY|BUTTON_REL, BUTTON_DISPLAY },
+ { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE },
+ { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_MORSE_INPUT, BUTTON_DISPLAY|BUTTON_POWER, BUTTON_NONE },
+ { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_keyboard */
-static const struct button_mapping button_context_bmark[] = {
- { ACTION_BMS_DELETE, BUTTON_REW, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_bmark */
+/*****************************************************************************
+ * Remote control mappings
+ *****************************************************************************/
-const struct button_mapping button_context_recscreen[] = {
- { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
-}; /* button_context_recscreen */
+static const struct button_mapping remote_button_context_standard[] = {
+ { ACTION_STD_PREV, BUTTON_RC_PLAY, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_RC_DISPLAY, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_RC_DISPLAY|BUTTON_REPEAT,BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
+ { ACTION_STD_MENU, BUTTON_RC_FAV, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+};
+
+static const struct button_mapping remote_button_context_wps[] = {
+ { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
+
+ { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
+ { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
+
+ { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
+ { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
+
+ { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_WPS_MENU, BUTTON_RC_FAV, BUTTON_NONE },
+
+ { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+};
+
+static const struct button_mapping remote_button_context_tree[] = {
+ { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
+ { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
+ { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+};
static const struct button_mapping* get_context_mapping_remote( int context )
{
context ^= CONTEXT_REMOTE;
-
+
switch (context)
{
- case CONTEXT_STD:
- case CONTEXT_MAINMENU:
- return remote_button_context_standard;
-
case CONTEXT_WPS:
return remote_button_context_wps;
-
- case CONTEXT_LIST:
- return remote_button_context_list;
+ case CONTEXT_MAINMENU:
case CONTEXT_TREE:
- if (global_settings.hold_lr_for_scroll_in_list)
- return remote_button_context_listtree_scroll_without_combo;
- else
- return remote_button_context_listtree_scroll_with_combo;
- case CONTEXT_CUSTOM|CONTEXT_TREE:
return remote_button_context_tree;
-
- case CONTEXT_QUICKSCREEN:
- return remote_button_context_quickscreen;
- case CONTEXT_PITCHSCREEN:
- return remote_button_context_pitchscreen;
- case CONTEXT_RECSCREEN:
- return button_context_recscreen;
-
- default:
- return remote_button_context_standard;
}
+ return remote_button_context_standard;
}
-/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
const struct button_mapping* get_context_mapping(int context)
{
if (context&CONTEXT_REMOTE)
@@ -351,17 +334,16 @@ const struct button_mapping* get_context_mapping(int context)
{
case CONTEXT_STD:
return button_context_standard;
-
case CONTEXT_WPS:
return button_context_wps;
case CONTEXT_LIST:
return button_context_list;
- case CONTEXT_TREE:
case CONTEXT_MAINMENU:
+ case CONTEXT_TREE:
if (global_settings.hold_lr_for_scroll_in_list)
return button_context_listtree_scroll_without_combo;
- else
+ else
return button_context_listtree_scroll_with_combo;
case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree;
@@ -369,13 +351,18 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_SETTINGS:
return button_context_settings;
case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
+ return button_context_settings_right_is_inc;
+
case CONTEXT_SETTINGS_COLOURCHOOSER:
+ return button_context_colorchooser;
case CONTEXT_SETTINGS_EQ:
+ return button_context_eq;
+
case CONTEXT_SETTINGS_TIME:
- return button_context_settings_right_is_inc;
-
+ return button_context_time;
+
case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
+ return button_context_yesno;
case CONTEXT_BOOKMARKSCREEN:
return button_context_bmark;
case CONTEXT_QUICKSCREEN:
@@ -384,11 +371,6 @@ const struct button_mapping* get_context_mapping(int context)
return button_context_pitchscreen;
case CONTEXT_KEYBOARD:
return button_context_keyboard;
- case CONTEXT_RECSCREEN:
- return button_context_recscreen;
-
- default:
- return button_context_standard;
- }
+ }
return button_context_standard;
}
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index ce90ad9004..85b65b26e4 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -73,7 +73,8 @@ const struct button_mapping generic_directions[] =
|| (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
|| (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
|| (CONFIG_KEYPAD == SANSA_C200_PAD) \
- || (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+ || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
+ || (CONFIG_KEYPAD == MROBE100_PAD)
{ PLA_UP, BUTTON_UP, BUTTON_NONE},
{ PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
@@ -112,8 +113,7 @@ const struct button_mapping generic_directions[] =
{PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
{PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
{PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) \
- || (CONFIG_KEYPAD == MROBE100_PAD)
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
{ PLA_UP, BUTTON_SCROLL_UP, BUTTON_NONE},
{ PLA_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE},
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
@@ -150,10 +150,11 @@ const struct button_mapping generic_left_right_fire[] =
{
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
|| (CONFIG_KEYPAD == IRIVER_H300_PAD) \
- || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
+ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
|| (CONFIG_KEYPAD == GIGABEAT_PAD) \
|| (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
- || (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+ || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
+ || (CONFIG_KEYPAD == MROBE100_PAD)
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
{ PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
{ PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
@@ -205,8 +206,7 @@ const struct button_mapping generic_left_right_fire[] =
{ PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
{ PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
{ PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) \
- || (CONFIG_KEYPAD == MROBE100_PAD)
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
{ PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
{ PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
@@ -312,8 +312,7 @@ const struct button_mapping generic_actions[] =
{PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
{PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
{PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif CONFIG_KEYPAD == IRIVER_H10_PAD \
- || (CONFIG_KEYPAD == MROBE100_PAD)
+#elif CONFIG_KEYPAD == IRIVER_H10_PAD
{PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
{PLA_START, BUTTON_PLAY, BUTTON_NONE},
{PLA_MENU, BUTTON_FF, BUTTON_NONE},
@@ -331,6 +330,12 @@ const struct button_mapping generic_actions[] =
{PLA_MENU, BUTTON_RC_MODE, BUTTON_NONE},
{PLA_FIRE, BUTTON_RC_HEART, BUTTON_NONE},
{PLA_FIRE_REPEAT, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == MROBE100_PAD
+ {PLA_QUIT, BUTTON_DISPLAY, BUTTON_NONE},
+ {PLA_START, BUTTON_PLAY, BUTTON_NONE},
+ {PLA_MENU, BUTTON_MENU, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
#elif (CONFIG_KEYPAD == COWOND2_PAD)
{PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
{PLA_START, BUTTON_UP, BUTTON_NONE},
@@ -347,14 +352,15 @@ const struct button_mapping generic_increase_decrease[] =
{
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
|| (CONFIG_KEYPAD == IRIVER_H300_PAD) \
- || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
+ || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
|| (CONFIG_KEYPAD == GIGABEAT_PAD) \
|| (CONFIG_KEYPAD == RECORDER_PAD) \
|| (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
|| (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
- || (CONFIG_KEYPAD == ONDIO_PAD) \
- || (CONFIG_KEYPAD == COWOND2_PAD) \
- || (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+ || (CONFIG_KEYPAD == ONDIO_PAD) \
+ || (CONFIG_KEYPAD == COWOND2_PAD) \
+ || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
+ || (CONFIG_KEYPAD == MROBE100_PAD)
{PLA_INC, BUTTON_UP, BUTTON_NONE},
{PLA_DEC, BUTTON_DOWN, BUTTON_NONE},
{PLA_INC_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
@@ -375,8 +381,7 @@ const struct button_mapping generic_increase_decrease[] =
#elif CONFIG_KEYPAD == PLAYER_PAD
{PLA_INC, BUTTON_STOP, BUTTON_NONE},
{PLA_DEC, BUTTON_PLAY, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) \
- || (CONFIG_KEYPAD == MROBE100_PAD)
+#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
{PLA_INC, BUTTON_SCROLL_UP, BUTTON_NONE},
{PLA_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE},
{PLA_INC_REPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE},
diff --git a/firmware/target/arm/olympus/mrobe-100/button-mr100.c b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
index 49561cb8d7..43db2c5f6d 100644
--- a/firmware/target/arm/olympus/mrobe-100/button-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
@@ -27,14 +27,562 @@
#include "backlight-target.h"
#include "system.h"
-void button_init_device(void)
+#define LOGF_ENABLE
+#include "logf.h"
+
+/* Driver for the Synaptics Touchpad based on the "Synaptics Modular Embedded
+ Protocol: 3-Wire Interface Specification" documentation */
+
+#define ACK (GPIOD_INPUT_VAL & 0x1)
+#define ACK_HI GPIOD_OUTPUT_VAL |= 0x1
+#define ACK_LO GPIOD_OUTPUT_VAL &= ~0x1
+
+#define CLK ((GPIOD_INPUT_VAL & 0x2) >> 1)
+#define CLK_HI GPIOD_OUTPUT_VAL |= 0x2
+#define CLK_LO GPIOD_OUTPUT_VAL &= ~0x2
+
+#define DATA ((GPIOD_INPUT_VAL & 0x4) >> 2)
+#define DATA_HI GPIOD_OUTPUT_EN |= 0x4; GPIOD_OUTPUT_VAL |= 0x4
+#define DATA_LO GPIOD_OUTPUT_EN |= 0x4; GPIOD_OUTPUT_VAL &= ~0x4
+
+#define LO 0
+#define HI 1
+
+#define STATUS_READY 1
+#define READ_RETRY 8
+#define READ_ERROR -1
+
+#define HELLO_HEADER 0x19
+#define HELLO_ID 0x1
+#define BUTTONS_HEADER 0x1a
+#define BUTTONS_ID 0x9
+#define ABSOLUTE_HEADER 0x0b
+
+static int syn_status = 0;
+static int int_btn = BUTTON_NONE;
+
+static int syn_wait_clk_change(unsigned int val)
+{
+ int i;
+
+ for (i = 0; i < 10000; i++)
+ {
+ if (CLK == val)
+ return 1;
+ }
+
+ return 0;
+}
+
+static inline int syn_get_data(void)
+{
+ GPIOD_OUTPUT_EN &= ~0x4;
+ return DATA;
+}
+
+static void syn_wait_guest_flush(void)
+{
+ /* Flush receiving (flushee) state:
+ handshake until DATA goes high during P3 stage */
+ if (CLK == LO)
+ {
+ ACK_HI; /* P1 -> P2 */
+ syn_wait_clk_change(HI); /* P2 -> P3 */
+ }
+
+ while (syn_get_data() == LO)
+ {
+ ACK_HI; /* P3 -> P0 */
+ syn_wait_clk_change(LO); /* P0 -> P1 */
+ ACK_LO; /* P1 -> P2 */
+ syn_wait_clk_change(HI); /* P2 -> P3 */
+ }
+
+ /* Continue handshaking until back to P0 */
+ ACK_HI; /* P3 -> P0 */
+}
+
+static void syn_flush(void)
+{
+ int i;
+
+ logf("syn_flush...");
+
+ /* Flusher holds DATA low for at least 36 handshake cycles */
+ DATA_LO;
+
+ for (i = 0; i < 36; i++)
+ {
+ syn_wait_clk_change(LO); /* P0 -> P1 */
+ ACK_LO; /* P1 -> P2 */
+ syn_wait_clk_change(HI); /* P2 -> P3 */
+ ACK_HI; /* P3 -> P0 */
+ }
+
+ /* Raise DATA in P1 stage */
+ syn_wait_clk_change(LO); /* P0 -> P1 */
+ DATA_HI;
+
+ /* After a flush, the flushing device enters a flush-receiving (flushee)
+ state */
+ syn_wait_guest_flush();
+}
+
+static int syn_send_data(int *data, int len)
+{
+ int i, bit;
+ int parity = 0;
+
+ logf("syn_send_data...");
+
+ /* 1. Lower DATA line to issue a request-to-send to guest */
+ DATA_LO;
+
+ /* 2. Wait for guest to lower CLK */
+ syn_wait_clk_change(LO);
+
+ /* 3. Lower ACK (with DATA still low) */
+ ACK_LO;
+
+ /* 4. Wait for guest to raise CLK */
+ syn_wait_clk_change(HI);
+
+ /* 5. Send data */
+ for (i = 0; i < len; i++)
+ {
+ logf(" sending byte: %d", data[i]);
+
+ bit = 0;
+ while (bit < 8)
+ {
+ /* 5a. Drive data low if bit is 0, or high if bit is 1 */
+ if (data[i] & (1 << bit))
+ {
+ DATA_HI;
+ parity++;
+ }
+ else
+ {
+ DATA_LO;
+ }
+ bit++;
+
+ /* 5b. Invert ACK to indicate that the data bit is ready */
+ ACK_HI;
+
+ /* 5c. Wait for guest to invert CLK */
+ syn_wait_clk_change(LO);
+
+ /* Repeat for next bit */
+ if (data[i] & (1 << bit))
+ {
+ DATA_HI;
+ parity++;
+ }
+ else
+ {
+ DATA_LO;
+ }
+ bit++;
+
+ ACK_LO;
+
+ syn_wait_clk_change(HI);
+ }
+ }
+
+ /* 7. Transmission termination sequence: */
+ /* 7a. Host may put parity bit on DATA. Hosts that do not generate
+ parity should set DATA high. Parity is 1 if there's an odd
+ number of '1' bits, or 0 if there's an even number of '1' bits. */
+ parity = parity % 2;
+ logf(" send parity = %d", parity);
+ if (parity)
+ {
+ DATA_HI;
+ }
+ else
+ {
+ DATA_LO;
+ }
+
+ /* 7b. Raise ACK to indicate that the optional parity bit is ready */
+ ACK_HI;
+
+ /* 7c. Guest lowers CLK */
+ syn_wait_clk_change(LO);
+
+ /* 7d. Pull DATA high (if parity bit was 0) */
+ DATA_HI;
+
+ /* 7e. Lower ACK to indicate that the stop bit is ready */
+ ACK_LO;
+
+ /* 7f. Guest raises CLK */
+ syn_wait_clk_change(HI);
+
+ /* 7g. If DATA is low, guest is flushing this transfer. Host should
+ enter the flushee state. */
+ if (syn_get_data() == LO)
+ {
+ logf(" module flushing");
+ syn_wait_guest_flush();
+ return -1;
+ }
+
+ /* 7h. Host raises ACK and the link enters the idle state */
+ ACK_HI;
+
+ return len;
+}
+
+static int syn_read_data(int *data, int data_len)
{
- /* taken from the mr-100 bootloader (offset 0x1e72) */
- //~ DEV_EN |= 0x20000; /* enable the touchpad ?? */
+ int i, len, bit, parity, tmp;
+ int *data_ptr;
+
+ logf("syn_read_data...");
+
+ /* 1. Guest drives CLK low */
+ if (CLK != LO)
+ return 0;
+
+ /* 1a. If the host is willing to receive a packet it lowers ACK */
+ ACK_LO;
+
+ /* 2. Guest may issue a request-to-send by lowering DATA. If the
+ guest decides not to transmit a packet, it may abort the
+ transmission by not lowering DATA. */
+
+ /* 3. The guest raises CLK */
+ syn_wait_clk_change(HI);
+
+ /* 4. If the guest is still driving DATA low, the transfer is commited
+ to occur. Otherwise, the transfer is aborted. In either case,
+ the host raises ACK. */
+ if (syn_get_data() == HI)
+ {
+ logf(" read abort");
+
+ ACK_HI;
+ return READ_ERROR;
+ }
+ else
+ {
+ ACK_HI;
+ }
+
+ /* 5. Read the incoming data packet */
+ i = 0;
+ len = 0;
+ parity = 0;
+ while (i <= len)
+ {
+ bit = 0;
+
+ if (i < data_len)
+ data_ptr = &data[i];
+ else
+ data_ptr = &tmp;
+
+ *data_ptr = 0;
+ while (bit < 8)
+ {
+ /* 5b. Guset inverts CLK to indicate that data is ready */
+ syn_wait_clk_change(LO);
+
+ /* 5d. Read the data bit from DATA */
+ if (syn_get_data() == HI)
+ {
+ *data_ptr |= (1 << bit);
+ parity++;
+ }
+ bit++;
+ /* 5e. Invert ACK to indicate that data has been read */
+ ACK_LO;
+
+ /* Repeat for next bit */
+ syn_wait_clk_change(HI);
+
+ if (syn_get_data() == HI)
+ {
+ *data_ptr |= (1 << bit);
+ parity++;
+ }
+ bit++;
+
+ ACK_HI;
+ }
+
+ /* First byte is the packet header */
+ if (i == 0)
+ {
+ /* Format control (bit 3) should be 1 */
+ if (*data_ptr & 0x8)
+ {
+ /* Packet length is bits 0:2 */
+ len = *data_ptr & 0x7;
+ logf(" packet length = %d", len);
+ }
+ else
+ {
+ logf(" invalid format ctrl bit");
+ return READ_ERROR;
+ }
+ }
+
+ i++;
+ }
+
+ /* 7. Transmission termination cycle */
+ /* 7a. The guest generates a parity bit on DATA */
+ /* 7b. The host waits for guest to lower CLK */
+ syn_wait_clk_change(LO);
+
+ /* 7c. The host verifies the parity bit is correct */
+ parity = parity % 2;
+ logf(" parity check: %d / %d", syn_get_data(), parity);
+ /* TODO: parity error handling */
+
+ /* 7d. The host lowers ACK */
+ ACK_LO;
+
+ /* 7e. The host waits for the guest to raise CLK indicating
+ that the stop bit is ready */
+ syn_wait_clk_change(HI);
+
+ /* 7f. The host reads DATA and verifies that it is 1 */
+ if (syn_get_data() == LO)
+ {
+ logf(" framing error");
+
+ ACK_HI;
+ return READ_ERROR;
+ }
+
+ ACK_HI;
+
+ return len;
+}
+
+static int syn_read_device(int *data, int len)
+{
+ int i;
+ int ret = READ_ERROR;
+
+ for (i = 0; i < READ_RETRY; i++)
+ {
+ if (syn_wait_clk_change(LO))
+ {
+ /* module is sending data */
+ ret = syn_read_data(data, len);
+ if (ret != READ_ERROR)
+ return ret;
+
+ syn_flush();
+ }
+ else
+ {
+ /* module is idle */
+ return 0;
+ }
+ }
+
+ return ret;
+}
+
+static int syn_reset(void)
+{
+ int val, id;
+ int data[2];
+
+ logf("syn_reset...");
+
+ /* reset module 0 */
+ val = (0 << 4) | (1 << 3) | 0;
+ syn_send_data(&val, 1);
+
+ val = syn_read_device(data, 2);
+ if (val == 1)
+ {
+ val = data[0] & 0xff; /* packet header */
+ id = (data[1] >> 4) & 0xf; /* packet id */
+ if ((val == HELLO_HEADER) && (id == HELLO_ID))
+ {
+ logf(" module 0 reset");
+ return 1;
+ }
+ }
+
+ logf(" reset failed");
+ return 0;
+}
+
+#if defined(ROCKBOX_HAS_LOGF) && defined(LOGF_ENABLE)
+static void syn_info(void)
+{
+ int i, val;
+ int data[8];
+
+ logf("syn_info...");
+
+ /* module base info */
+ logf("module base info:");
+ data[0] = (0 << 4) | (0 << 3) | 1;
+ data[1] = 0x80;
+ syn_send_data(data, 2);
+ val = syn_read_device(data, 8);
+ if (val > 0)
+ {
+ for (i = 0; i < 8; i++)
+ logf(" data[%d] = 0x%02x", i, data[i]);
+ }
+
+ /* module product info */
+ logf("module product info:");
+ data[0] = (0 << 4) | (0 << 3) | 1;
+ data[1] = 0x81;
+ syn_send_data(data, 2);
+ val = syn_read_device(data, 8);
+ if (val > 0)
+ {
+ for (i = 0; i < 8; i++)
+ logf(" data[%d] = 0x%02x", i, data[i]);
+ }
+
+ /* module serialization */
+ logf("module serialization:");
+ data[0] = (0 << 4) | (0 << 3) | 1;
+ data[1] = 0x82;
+ syn_send_data(data, 2);
+ val = syn_read_device(data, 8);
+ if (val > 0)
+ {
+ for (i = 0; i < 8; i++)
+ logf(" data[%d] = 0x%02x", i, data[i]);
+ }
+
+ /* 1-D sensor info */
+ logf("1-d sensor info:");
+ data[0] = (0 << 4) | (0 << 3) | 1;
+ data[1] = 0x80 + 0x20;
+ syn_send_data(data, 2);
+ val = syn_read_device(data, 8);
+ if (val > 0)
+ {
+ for (i = 0; i < 8; i++)
+ logf(" data[%d] = 0x%02x", i, data[i]);
+ }
+}
+#endif
+
+void button_init_device(void)
+{
/* enable touchpad leds */
- GPIOA_ENABLE |= 0xff;
+ GPIOA_ENABLE |= BUTTONLIGHT_ALL;
GPIOA_OUTPUT_EN |= BUTTONLIGHT_ALL;
+
+ /* enable touchpad */
+ GPO32_ENABLE |= 0x40000000;
+ GPO32_VAL &= ~0x40000000;
+
+ /* enable ACK, CLK, DATA lines */
+ GPIOD_ENABLE |= (0x1 | 0x2 | 0x4);
+
+ GPIOD_OUTPUT_EN |= 0x1; /* ACK */
+ GPIOD_OUTPUT_VAL |= 0x1; /* high */
+
+ GPIOD_OUTPUT_EN &= ~0x2; /* CLK */
+
+ GPIOD_OUTPUT_EN |= 0x4; /* DATA */
+ GPIOD_OUTPUT_VAL |= 0x4; /* high */
+
+ syn_flush();
+
+ if (syn_reset())
+ {
+#if defined(ROCKBOX_HAS_LOGF) && defined(LOGF_ENABLE)
+ syn_info();
+#endif
+
+ syn_status = STATUS_READY;
+
+ /* enable interrupts */
+ GPIOD_INT_LEV &= ~0x2;
+ GPIOD_INT_CLR |= 0x2;
+ GPIOD_INT_EN |= 0x2;
+
+ CPU_INT_EN |= HI_MASK;
+ CPU_HI_INT_EN |= GPIO0_MASK;
+ }
+}
+
+/*
+ * Button interrupt handler
+ */
+void button_int(void)
+{
+ int data[4];
+ int val, id;
+
+ int_btn = BUTTON_NONE;
+
+ if (syn_status == STATUS_READY)
+ {
+ /* disable interrupt while we read the touchpad */
+ GPIOD_INT_EN &= ~0x2;
+
+ val = syn_read_device(data, 4);
+ if (val > 0)
+ {
+ val = data[0] & 0xff; /* packet header */
+ id = (data[1] >> 4) & 0xf; /* packet id */
+
+ logf("button_read_device...");
+ logf(" data[0] = 0x%08x", data[0]);
+ logf(" data[1] = 0x%08x", data[1]);
+ logf(" data[2] = 0x%08x", data[2]);
+ logf(" data[3] = 0x%08x", data[3]);
+
+ if ((val == BUTTONS_HEADER) && (id == BUTTONS_ID))
+ {
+ /* Buttons packet - touched one of the 5 "buttons" */
+ if (data[1] & 0x1)
+ int_btn |= BUTTON_PLAY;
+ if (data[1] & 0x2)
+ int_btn |= BUTTON_MENU;
+ if (data[1] & 0x4)
+ int_btn |= BUTTON_LEFT;
+ if (data[1] & 0x8)
+ int_btn |= BUTTON_DISPLAY;
+ if (data[2] & 0x1)
+ int_btn |= BUTTON_RIGHT;
+
+ /* An Absolute packet should follow which we ignore */
+ val = syn_read_device(data, 4);
+
+ logf(" int_btn = 0x%04x", int_btn);
+ }
+ else if (val == ABSOLUTE_HEADER)
+ {
+ /* Absolute packet - the finger is on the vertical strip.
+ Position ranges from 1-4095, with 1 at the bottom. */
+ val = ((data[1] >> 4) << 8) | data[2]; /* position */
+ if ((val > 0) && (val <= 1365))
+ int_btn |= BUTTON_DOWN;
+ else if ((val > 1365) && (val <= 2730))
+ int_btn |= BUTTON_SELECT;
+ else if ((val > 2730) && (val <= 4095))
+ int_btn |= BUTTON_UP;
+ }
+ }
+
+ /* re-enable interrupts */
+ GPIOD_INT_LEV &= ~0x2;
+ GPIOD_INT_CLR |= 0x2;
+ GPIOD_INT_EN |= 0x2;
+ }
}
/*
@@ -42,11 +590,11 @@ void button_init_device(void)
*/
int button_read_device(void)
{
- int btn = BUTTON_NONE;
-
- if(~GPIOA_INPUT_VAL & 0x40)
+ int btn = int_btn;
+
+ if (~GPIOA_INPUT_VAL & 0x40)
btn |= BUTTON_POWER;
-
+
return btn;
}
diff --git a/firmware/target/arm/olympus/mrobe-100/button-target.h b/firmware/target/arm/olympus/mrobe-100/button-target.h
index c7d9114004..78b37f6ba6 100644
--- a/firmware/target/arm/olympus/mrobe-100/button-target.h
+++ b/firmware/target/arm/olympus/mrobe-100/button-target.h
@@ -28,6 +28,7 @@
bool button_hold(void);
void button_init_device(void);
int button_read_device(void);
+void button_int(void);
#define POWEROFF_BUTTON BUTTON_POWER
#define POWEROFF_COUNT 10
@@ -36,25 +37,33 @@ int button_read_device(void);
for the H10 keypad & remote. THESE ARE NOT CORRECT! */
/* Main unit's buttons */
-#define BUTTON_POWER 0x00000001
-#define BUTTON_LEFT 0x00000002
-#define BUTTON_RIGHT 0x00000004
-#define BUTTON_REW 0x00000008
-#define BUTTON_PLAY 0x00000010
-#define BUTTON_FF 0x00000020
-#define BUTTON_SCROLL_UP 0x00000040
-#define BUTTON_SCROLL_DOWN 0x00000080
-#define BUTTON_MAIN (BUTTON_POWER|BUTTON_O|BUTTON_BACK|BUTTON_REW\
- |BUTTON_PLAY|BUTTON_FF)
+#define BUTTON_PLAY 0x00000001
+#define BUTTON_MENU 0x00000002
+#define BUTTON_LEFT 0x00000004
+#define BUTTON_DISPLAY 0x00000008
+#define BUTTON_RIGHT 0x00000010
+#define BUTTON_SELECT 0x00000020
+#define BUTTON_UP 0x00000040
+#define BUTTON_SLIDE_UP 0x00000080
+#define BUTTON_DOWN 0x00000100
+#define BUTTON_SLIDE_DOWN 0x00000200
+#define BUTTON_POWER 0x00000400
+#define BUTTON_MAIN (BUTTON_PLAY|BUTTON_MENU|BUTTON_LEFT|BUTTON_DISPLAY\
+ |BUTTON_RIGHT|BUTTON_SELECT|BUTTON_UP|BUTTON_SLIDE_UP\
+ |BUTTON_DOWN|BUTTON_SLIDE_DOWN|BUTTON_POWER)
/* Remote control's buttons */
-#define BUTTON_RC_REW 0x00080000
-#define BUTTON_RC_PLAY 0x00100000
-#define BUTTON_RC_FF 0x00200000
+#define BUTTON_RC_PLAY 0x00010000
+#define BUTTON_RC_REW 0x00020000
+#define BUTTON_RC_FF 0x00040000
+#define BUTTON_RC_DISPLAY 0x00080000
+#define BUTTON_RC_FAV 0x00100000
+#define BUTTON_RC_MODE 0x00200000
#define BUTTON_RC_VOL_UP 0x00400000
#define BUTTON_RC_VOL_DOWN 0x00800000
-#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN\
- |BUTTON_RC_REW|BUTTON_RC_FF)
+#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_REW|BUTTON_RC_FF|\
+ |BUTTON_RC_DISPLAY|BUTTON_RC_FAV|BUTTON_RC_MODE\
+ |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
#define RC_POWEROFF_BUTTON BUTTON_RC_PLAY
#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index 0b5e9e1c13..3dd802a3ed 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -35,6 +35,9 @@ extern void microsd_int(void); /* Sansa E200 and C200 */
extern void button_int(void);
extern void clickwheel_int(void);
#endif
+#ifdef MROBE_100
+extern void button_int(void);
+#endif
void irq(void)
{
@@ -66,6 +69,11 @@ void irq(void)
if (GPIOL_INT_STAT & 0x08)
microsd_int();
}
+#elif defined(MROBE_100)
+ else if (CPU_HI_INT_STAT & GPIO0_MASK) {
+ if (GPIOD_INT_STAT & 0x2)
+ button_int();
+ }
#endif
#ifdef HAVE_USBSTACK
else if (CPU_INT_STAT & USB_MASK) {
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index cea65c9fa6..0b347c9322 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -673,6 +673,15 @@ void button_event(int key, bool pressed)
break;
#elif CONFIG_KEYPAD == MROBE100_PAD
+ case SDLK_KP1:
+ new_btn = BUTTON_DISPLAY;
+ break;
+ case SDLK_KP7:
+ new_btn = BUTTON_MENU;
+ break;
+ case SDLK_KP9:
+ new_btn = BUTTON_PLAY;
+ break;
case SDLK_KP4:
case SDLK_LEFT:
new_btn = BUTTON_LEFT;
@@ -683,32 +692,21 @@ void button_event(int key, bool pressed)
break;
case SDLK_KP8:
case SDLK_UP:
- new_btn = BUTTON_SCROLL_UP;
+ new_btn = BUTTON_UP;
break;
case SDLK_KP2:
case SDLK_DOWN:
- new_btn = BUTTON_SCROLL_DOWN;
+ new_btn = BUTTON_DOWN;
break;
- case SDLK_KP_PLUS:
- case SDLK_F8:
- new_btn = BUTTON_POWER;
+ case SDLK_KP5:
+ case SDLK_SPACE:
+ new_btn = BUTTON_SELECT;
break;
+ case SDLK_F8:
case SDLK_ESCAPE:
new_btn = BUTTON_POWER;
break;
- case SDLK_KP_DIVIDE:
- case SDLK_F1:
- new_btn = BUTTON_REW;
- break;
- case SDLK_KP_MULTIPLY:
- case SDLK_F2:
- new_btn = BUTTON_FF;
- break;
- case SDLK_KP5:
- case SDLK_SPACE:
- new_btn = BUTTON_PLAY;
- break;
-
+
#elif CONFIG_KEYPAD == COWOND2_PAD
case SDLK_KP4:
case SDLK_LEFT: