summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/SOURCES2
-rw-r--r--apps/keymaps/keymap-cowond2.c177
-rw-r--r--apps/plugins/SOURCES2
-rw-r--r--apps/plugins/lib/pluginlib_actions.c22
-rw-r--r--apps/plugins/plugin.lds4
5 files changed, 206 insertions, 1 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 38192316a6..c93c5bcc1f 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -164,4 +164,6 @@ keymaps/keymap-av300.c
164keymaps/keymap-mr500.c 164keymaps/keymap-mr500.c
165#elif CONFIG_KEYPAD == MROBE100_PAD 165#elif CONFIG_KEYPAD == MROBE100_PAD
166keymaps/keymap-mr100.c 166keymaps/keymap-mr100.c
167#elif CONFIG_KEYPAD == COWOND2_PAD
168keymaps/keymap-cowond2.c
167#endif 169#endif
diff --git a/apps/keymaps/keymap-cowond2.c b/apps/keymaps/keymap-cowond2.c
new file mode 100644
index 0000000000..ab4216e9cf
--- /dev/null
+++ b/apps/keymaps/keymap-cowond2.c
@@ -0,0 +1,177 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id
9 *
10 * Copyright (C) 2008 Rob Purchase
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/* Button Code Definitions for the Cowon D2 target */
21/* Some of these mappings are rather 'creative', given it only has 3 buttons! */
22
23#include <stdio.h>
24#include <string.h>
25#include <stdlib.h>
26
27#include "config.h"
28#include "action.h"
29#include "button.h"
30#include "settings.h"
31
32/*
33 * The format of the list is as follows
34 * { Action Code, Button code, Prereq button code }
35 * if there's no need to check the previous button's value, use BUTTON_NONE
36 * Insert LAST_ITEM_IN_LIST at the end of each mapping
37 */
38
39static const struct button_mapping button_context_standard[] = {
40 { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE },
41 { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
42 { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE },
43 { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
44
45 { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
46 //{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
47 //{ ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
48
49 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
50 // { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
51 { ACTION_STD_CONTEXT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
52 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
53// { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
54// { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
55 LAST_ITEM_IN_LIST
56}; /* button_context_standard */
57
58
59static const struct button_mapping button_context_wps[] = {
60 LAST_ITEM_IN_LIST
61}; /* button_context_wps */
62
63static const struct button_mapping button_context_list[] = {
64 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
65}; /* button_context_list */
66
67static const struct button_mapping button_context_tree[] = {
68 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
69}; /* button_context_tree */
70
71static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
72 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
73};
74
75static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
76 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
77};
78
79static const struct button_mapping button_context_settings[] = {
80 { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE },
81 { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE },
82 { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE },
83 { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE },
84 { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE },
85 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
86
87 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
88}; /* button_context_settings */
89
90static const struct button_mapping button_context_settings_right_is_inc[] = {
91
92 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
93}; /* button_context_settingsgraphical */
94
95static const struct button_mapping button_context_yesno[] = {
96 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
97}; /* button_context_settings_yesno */
98
99static const struct button_mapping button_context_colorchooser[] = {
100 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
101}; /* button_context_colorchooser */
102
103static const struct button_mapping button_context_eq[] = {
104 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
105}; /* button_context_eq */
106
107/** Bookmark Screen **/
108static const struct button_mapping button_context_bmark[] = {
109 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
110}; /* button_context_bmark */
111
112static const struct button_mapping button_context_time[] = {
113 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
114}; /* button_context_time */
115
116static const struct button_mapping button_context_quickscreen[] = {
117
118 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
119}; /* button_context_quickscreen */
120
121static const struct button_mapping button_context_pitchscreen[] = {
122
123 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
124}; /* button_context_pitchcreen */
125
126static const struct button_mapping button_context_keyboard[] = {
127
128 LAST_ITEM_IN_LIST
129}; /* button_context_keyboard */
130
131extern int current_tick;
132const struct button_mapping* get_context_mapping(int context)
133{
134 switch (context&(~CONTEXT_REMOTE))
135 {
136 case CONTEXT_STD:
137 return button_context_standard;
138 case CONTEXT_WPS:
139 return button_context_wps;
140
141 case CONTEXT_LIST:
142 return button_context_list;
143 case CONTEXT_MAINMENU:
144 case CONTEXT_TREE:
145 if (global_settings.hold_lr_for_scroll_in_list)
146 return button_context_listtree_scroll_without_combo;
147 else
148 return button_context_listtree_scroll_with_combo;
149 case CONTEXT_CUSTOM|CONTEXT_TREE:
150 return button_context_tree;
151
152 case CONTEXT_SETTINGS:
153 return button_context_settings;
154 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
155 return button_context_settings_right_is_inc;
156
157 case CONTEXT_SETTINGS_COLOURCHOOSER:
158 return button_context_colorchooser;
159 case CONTEXT_SETTINGS_EQ:
160 return button_context_eq;
161
162 case CONTEXT_SETTINGS_TIME:
163 return button_context_time;
164
165 case CONTEXT_YESNOSCREEN:
166 return button_context_yesno;
167 case CONTEXT_BOOKMARKSCREEN:
168 return button_context_bmark;
169 case CONTEXT_QUICKSCREEN:
170 return button_context_quickscreen;
171 case CONTEXT_PITCHSCREEN:
172 return button_context_pitchscreen;
173 case CONTEXT_KEYBOARD:
174 return button_context_keyboard;
175 }
176 return button_context_standard;
177}
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 392544dbbf..4444934e36 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -1,4 +1,4 @@
1#ifndef OLYMPUS_MROBE_100 1#if !defined(OLYMPUS_MROBE_100)
2 2
3/* plugins common to all models */ 3/* plugins common to all models */
4battery_bench.c 4battery_bench.c
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index d277fe6d0d..e74ffc0315 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -130,6 +130,15 @@ const struct button_mapping generic_directions[] =
130 { PLA_DOWN_REPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE}, 130 { PLA_DOWN_REPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE},
131 { PLA_LEFT_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE}, 131 { PLA_LEFT_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE},
132 { PLA_RIGHT_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE}, 132 { PLA_RIGHT_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
133#elif (CONFIG_KEYPAD == COWOND2_PAD)
134 { PLA_UP, BUTTON_UP, BUTTON_NONE},
135 { PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
136 { PLA_LEFT, BUTTON_UP, BUTTON_MENU},
137 { PLA_RIGHT, BUTTON_DOWN, BUTTON_MENU},
138 { PLA_UP_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
139 { PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
140 { PLA_LEFT_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_MENU},
141 { PLA_RIGHT_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_MENU},
133#else 142#else
134 #error pluginlib_actions: Unsupported keypad 143 #error pluginlib_actions: Unsupported keypad
135#endif 144#endif
@@ -209,6 +218,13 @@ const struct button_mapping generic_left_right_fire[] =
209 { PLA_RIGHT_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE}, 218 { PLA_RIGHT_REPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE},
210 { PLA_FIRE, BUTTON_RC_HEART, BUTTON_NONE}, 219 { PLA_FIRE, BUTTON_RC_HEART, BUTTON_NONE},
211 { PLA_FIRE_REPEAT, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_NONE}, 220 { PLA_FIRE_REPEAT, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_NONE},
221#elif (CONFIG_KEYPAD == COWOND2_PAD)
222 { PLA_LEFT, BUTTON_UP, BUTTON_NONE},
223 { PLA_RIGHT, BUTTON_DOWN, BUTTON_NONE},
224 { PLA_LEFT_REPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
225 { PLA_RIGHT_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
226 { PLA_FIRE, BUTTON_MENU, BUTTON_NONE},
227 { PLA_FIRE_REPEAT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE},
212#else 228#else
213 #error pluginlib_actions: Unsupported keypad 229 #error pluginlib_actions: Unsupported keypad
214#endif 230#endif
@@ -307,6 +323,12 @@ const struct button_mapping generic_actions[] =
307 {PLA_MENU, BUTTON_RC_MODE, BUTTON_NONE}, 323 {PLA_MENU, BUTTON_RC_MODE, BUTTON_NONE},
308 {PLA_FIRE, BUTTON_RC_HEART, BUTTON_NONE}, 324 {PLA_FIRE, BUTTON_RC_HEART, BUTTON_NONE},
309 {PLA_FIRE_REPEAT, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_NONE}, 325 {PLA_FIRE_REPEAT, BUTTON_RC_HEART|BUTTON_REPEAT, BUTTON_NONE},
326#elif (CONFIG_KEYPAD == COWOND2_PAD)
327 {PLA_QUIT, BUTTON_POWER, BUTTON_NONE},
328 {PLA_START, BUTTON_UP, BUTTON_NONE},
329 {PLA_MENU, BUTTON_DOWN, BUTTON_NONE},
330 {PLA_FIRE, BUTTON_MENU, BUTTON_NONE},
331 {PLA_FIRE_REPEAT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE},
310#else 332#else
311 #error pluginlib_actions: Unsupported keypad 333 #error pluginlib_actions: Unsupported keypad
312#endif 334#endif
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index e877811365..a08a4a8a54 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -60,6 +60,10 @@ OUTPUT_FORMAT(elf32-sh)
60#define IRAMORIG DRAMORIG 60#define IRAMORIG DRAMORIG
61#define IRAMSIZE 0x4000 61#define IRAMSIZE 0x4000
62#define IRAM DRAM 62#define IRAM DRAM
63#elif defined(CPU_TCC780X)
64#define DRAMORIG 0x20000000
65#define IRAMORIG 0x1000c000
66#define IRAMSIZE 0xc000
63#else 67#else
64#define DRAMORIG 0x09000000 + STUBOFFSET 68#define DRAMORIG 0x09000000 + STUBOFFSET
65#endif 69#endif