diff options
28 files changed, 1215 insertions, 33 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 313e5e0aec..acf4e055cc 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -239,6 +239,8 @@ keymaps/keymap-creativezv.c | |||
239 | keymaps/keymap-sa9200.c | 239 | keymaps/keymap-sa9200.c |
240 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | 240 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD |
241 | keymaps/keymap-hdd1630.c | 241 | keymaps/keymap-hdd1630.c |
242 | #elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
243 | keymaps/keymap-hdd6330.c | ||
242 | #elif CONFIG_KEYPAD == IAUDIO67_PAD | 244 | #elif CONFIG_KEYPAD == IAUDIO67_PAD |
243 | keymaps/keymap-iaudio67.c | 245 | keymaps/keymap-iaudio67.c |
244 | #elif CONFIG_KEYPAD == SANSA_C100_PAD | 246 | #elif CONFIG_KEYPAD == SANSA_C100_PAD |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 2691d2dc8d..dd16a4ef4c 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -977,7 +977,8 @@ static bool dbg_spdif(void) | |||
977 | 977 | ||
978 | /* This is temporary until the SA9200 touchpad works */ | 978 | /* This is temporary until the SA9200 touchpad works */ |
979 | #elif (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ | 979 | #elif (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ |
980 | (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) | 980 | (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ |
981 | (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) | ||
981 | # define DEBUG_CANCEL BUTTON_POWER | 982 | # define DEBUG_CANCEL BUTTON_POWER |
982 | 983 | ||
983 | #elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) | 984 | #elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) |
@@ -1142,7 +1143,7 @@ extern unsigned char serbuf[]; | |||
1142 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); | 1143 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); |
1143 | lcd_putsf(0, line++, "REM: %03x PAD: %03x", | 1144 | lcd_putsf(0, line++, "REM: %03x PAD: %03x", |
1144 | adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); | 1145 | adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); |
1145 | #elif defined(PHILIPS_HDD1630) | 1146 | #elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
1146 | line++; | 1147 | line++; |
1147 | lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", | 1148 | lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", |
1148 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); | 1149 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); |
diff --git a/apps/keymaps/keymap-hdd6330.c b/apps/keymaps/keymap-hdd6330.c new file mode 100644 index 0000000000..f6f9ab9c8c --- /dev/null +++ b/apps/keymaps/keymap-hdd6330.c | |||
@@ -0,0 +1,465 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | /* Button Code Definitions for the toshiba gigabeat target */ | ||
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 | |||
39 | /* CONTEXT_CUSTOM's used in this file... | ||
40 | |||
41 | CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) | ||
42 | CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens | ||
43 | i.e where up/down is inc/dec | ||
44 | CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec | ||
45 | |||
46 | */ | ||
47 | |||
48 | |||
49 | static const struct button_mapping button_context_standard[] = { | ||
50 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
51 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
52 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
53 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
54 | |||
55 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, | ||
56 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
57 | |||
58 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, | ||
59 | |||
60 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
61 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
62 | |||
63 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
64 | { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, | ||
65 | |||
66 | LAST_ITEM_IN_LIST | ||
67 | }; /* button_context_standard */ | ||
68 | |||
69 | |||
70 | static const struct button_mapping button_context_wps[] = { | ||
71 | { ACTION_WPS_PLAY, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
72 | { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
73 | |||
74 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
75 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
76 | |||
77 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
78 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
79 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
80 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
81 | |||
82 | { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
83 | { ACTION_WPS_ABSETA_PREVDIR, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
84 | { ACTION_WPS_ABRESET, BUTTON_VIEW|BUTTON_SELECT, BUTTON_NONE }, | ||
85 | |||
86 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
87 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
88 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
89 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
90 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
91 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, | ||
92 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
93 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
94 | |||
95 | { ACTION_WPS_PITCHSCREEN, BUTTON_VIEW|BUTTON_UP, BUTTON_VIEW }, | ||
96 | { ACTION_WPS_VIEW_PLAYLIST, BUTTON_VIEW|BUTTON_DOWN, BUTTON_VIEW }, | ||
97 | |||
98 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
99 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
100 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
101 | |||
102 | { ACTION_WPS_ID3SCREEN, BUTTON_VIEW|BUTTON_MENU, BUTTON_NONE }, | ||
103 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
104 | |||
105 | LAST_ITEM_IN_LIST | ||
106 | }; /* button_context_wps */ | ||
107 | |||
108 | static const struct button_mapping button_context_list[] = { | ||
109 | { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP, BUTTON_VIEW }, | ||
110 | { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_VIEW|BUTTON_UP }, | ||
111 | { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
112 | { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_VIEW }, | ||
113 | { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_VIEW|BUTTON_DOWN }, | ||
114 | { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
115 | #ifdef HAVE_VOLUME_IN_LIST | ||
116 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
117 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
118 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
119 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
120 | #endif | ||
121 | |||
122 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
123 | }; /* button_context_list */ | ||
124 | |||
125 | static const struct button_mapping button_context_tree[] = { | ||
126 | { ACTION_TREE_WPS, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
127 | { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, | ||
128 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
129 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | ||
130 | |||
131 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) | ||
132 | }; /* button_context_tree */ | ||
133 | |||
134 | static const struct button_mapping button_context_listtree_scroll_with_combo[] = { | ||
135 | { ACTION_NONE, BUTTON_VIEW, BUTTON_NONE }, | ||
136 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_VIEW }, | ||
137 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_VIEW|BUTTON_LEFT }, | ||
138 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL }, | ||
139 | { ACTION_TREE_ROOT_INIT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_VIEW|BUTTON_LEFT }, | ||
140 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
141 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_VIEW }, | ||
142 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_VIEW|BUTTON_RIGHT }, | ||
143 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL }, | ||
144 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
145 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
146 | }; | ||
147 | |||
148 | static const struct button_mapping button_context_listtree_scroll_without_combo[] = { | ||
149 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, | ||
150 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
151 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
152 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
153 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
154 | { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, | ||
155 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
156 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
157 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
158 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
159 | }; | ||
160 | |||
161 | static const struct button_mapping button_context_settings[] = { | ||
162 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
163 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
164 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
165 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
166 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, | ||
167 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
168 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, | ||
169 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
170 | { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
171 | |||
172 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
173 | }; /* button_context_settings */ | ||
174 | |||
175 | static const struct button_mapping button_context_settings_right_is_inc[] = { | ||
176 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, | ||
177 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
178 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, | ||
179 | { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
180 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
181 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
182 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
183 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
184 | { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
185 | |||
186 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
187 | }; /* button_context_settingsgraphical */ | ||
188 | |||
189 | static const struct button_mapping button_context_yesno[] = { | ||
190 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, | ||
191 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
192 | }; /* button_context_settings_yesno */ | ||
193 | |||
194 | static const struct button_mapping button_context_colorchooser[] = { | ||
195 | { ACTION_STD_OK, BUTTON_VIEW|BUTTON_REL, BUTTON_NONE }, | ||
196 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
197 | }; /* button_context_colorchooser */ | ||
198 | |||
199 | static const struct button_mapping button_context_eq[] = { | ||
200 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
201 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
202 | }; /* button_context_eq */ | ||
203 | |||
204 | /** Bookmark Screen **/ | ||
205 | static const struct button_mapping button_context_bmark[] = { | ||
206 | { ACTION_BMS_DELETE, BUTTON_VIEW, BUTTON_NONE }, | ||
207 | |||
208 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
209 | }; /* button_context_bmark */ | ||
210 | |||
211 | static const struct button_mapping button_context_time[] = { | ||
212 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
213 | { ACTION_STD_OK, BUTTON_VIEW, BUTTON_NONE }, | ||
214 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), | ||
215 | }; /* button_context_time */ | ||
216 | |||
217 | static const struct button_mapping button_context_quickscreen[] = { | ||
218 | { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, | ||
219 | { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
220 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
221 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
222 | { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
223 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
224 | { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
225 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
226 | { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, | ||
227 | |||
228 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
229 | }; /* button_context_quickscreen */ | ||
230 | |||
231 | static const struct button_mapping button_context_pitchscreen[] = { | ||
232 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, | ||
233 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
234 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, | ||
235 | { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
236 | { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
237 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, | ||
238 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
239 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, | ||
240 | { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, | ||
241 | { ACTION_PS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
242 | { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, | ||
243 | { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
244 | { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
245 | |||
246 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
247 | }; /* button_context_pitchcreen */ | ||
248 | |||
249 | static const struct button_mapping button_context_keyboard[] = { | ||
250 | { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
251 | { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
252 | { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
253 | { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
254 | { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
255 | { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
256 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
257 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
258 | { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, | ||
259 | { ACTION_KBD_PAGE_FLIP, BUTTON_VIEW|BUTTON_MENU, BUTTON_NONE }, | ||
260 | { ACTION_KBD_DONE, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
261 | { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
262 | { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, | ||
263 | { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
264 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, | ||
265 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
266 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
267 | { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
268 | { ACTION_KBD_MORSE_INPUT, BUTTON_VIEW|BUTTON_POWER, BUTTON_NONE }, | ||
269 | { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
270 | |||
271 | LAST_ITEM_IN_LIST | ||
272 | }; /* button_context_keyboard */ | ||
273 | |||
274 | #if CONFIG_TUNER | ||
275 | static const struct button_mapping button_context_radio[] = { | ||
276 | { ACTION_FM_MENU, BUTTON_MENU | BUTTON_REL, BUTTON_MENU }, | ||
277 | { ACTION_FM_MODE, BUTTON_MENU | BUTTON_REPEAT, BUTTON_MENU }, | ||
278 | { ACTION_FM_PRESET, BUTTON_VIEW, BUTTON_NONE }, | ||
279 | { ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT }, | ||
280 | { ACTION_FM_STOP, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_SELECT }, | ||
281 | { ACTION_FM_EXIT, BUTTON_POWER, BUTTON_NONE }, | ||
282 | |||
283 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) | ||
284 | }; | ||
285 | #endif | ||
286 | |||
287 | #ifdef USB_ENABLE_HID | ||
288 | static const struct button_mapping button_context_usb_hid[] = { | ||
289 | { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
290 | { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER }, | ||
291 | |||
292 | LAST_ITEM_IN_LIST | ||
293 | }; /* button_context_usb_hid */ | ||
294 | |||
295 | static const struct button_mapping button_context_usb_hid_mode_multimedia[] = { | ||
296 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
297 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
298 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
299 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
300 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
301 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
302 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
303 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST }, | ||
304 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
305 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
306 | |||
307 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
308 | }; /* button_context_usb_hid_mode_multimedia */ | ||
309 | |||
310 | static const struct button_mapping button_context_usb_hid_mode_presentation[] = { | ||
311 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
312 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
313 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
314 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW }, | ||
315 | { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
316 | { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
317 | { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
318 | { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, | ||
319 | { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST }, | ||
320 | { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST }, | ||
321 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP }, | ||
322 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP }, | ||
323 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN }, | ||
324 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN }, | ||
325 | { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
326 | { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
327 | |||
328 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
329 | }; /* button_context_usb_hid_mode_presentation */ | ||
330 | |||
331 | static const struct button_mapping button_context_usb_hid_mode_browser[] = { | ||
332 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
333 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
334 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
335 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
336 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP }, | ||
337 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN }, | ||
338 | { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP }, | ||
339 | { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN }, | ||
340 | { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
341 | { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
342 | { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
343 | { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST }, | ||
344 | { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
345 | { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, | ||
346 | { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
347 | |||
348 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
349 | }; /* button_context_usb_hid_mode_browser */ | ||
350 | |||
351 | #ifdef HAVE_USB_HID_MOUSE | ||
352 | static const struct button_mapping button_context_usb_hid_mode_mouse[] = { | ||
353 | { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE }, | ||
354 | { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
355 | { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
356 | { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
357 | { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
358 | { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
359 | { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
360 | { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
361 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE }, | ||
362 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
363 | { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE }, | ||
364 | { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
365 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE }, | ||
366 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
367 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, | ||
368 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
369 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE }, | ||
370 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
371 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_PLAYLIST, BUTTON_NONE }, | ||
372 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_NONE }, | ||
373 | { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_PLAYLIST|BUTTON_UP, BUTTON_NONE }, | ||
374 | { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_PLAYLIST|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
375 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_PLAYLIST|BUTTON_DOWN, BUTTON_NONE }, | ||
376 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PLAYLIST|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
377 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PLAYLIST|BUTTON_LEFT, BUTTON_NONE }, | ||
378 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_PLAYLIST|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
379 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_PLAYLIST|BUTTON_RIGHT, BUTTON_NONE }, | ||
380 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_PLAYLIST|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
381 | { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_VIEW, BUTTON_NONE }, | ||
382 | { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_VIEW|BUTTON_REL, BUTTON_NONE }, | ||
383 | { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_VIEW|BUTTON_UP, BUTTON_NONE }, | ||
384 | { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
385 | { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_NONE }, | ||
386 | { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
387 | { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
388 | { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
389 | { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
390 | { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
391 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
392 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
393 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
394 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
395 | |||
396 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
397 | |||
398 | }; /* button_context_usb_hid_mode_mouse */ | ||
399 | #endif | ||
400 | #endif | ||
401 | |||
402 | const struct button_mapping* get_context_mapping(int context) | ||
403 | { | ||
404 | switch (context) | ||
405 | { | ||
406 | case CONTEXT_STD: | ||
407 | return button_context_standard; | ||
408 | case CONTEXT_WPS: | ||
409 | return button_context_wps; | ||
410 | |||
411 | case CONTEXT_LIST: | ||
412 | return button_context_list; | ||
413 | case CONTEXT_MAINMENU: | ||
414 | case CONTEXT_TREE: | ||
415 | if (global_settings.hold_lr_for_scroll_in_list) | ||
416 | return button_context_listtree_scroll_without_combo; | ||
417 | else | ||
418 | return button_context_listtree_scroll_with_combo; | ||
419 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
420 | return button_context_tree; | ||
421 | |||
422 | case CONTEXT_SETTINGS: | ||
423 | return button_context_settings; | ||
424 | case CONTEXT_CUSTOM|CONTEXT_SETTINGS: | ||
425 | return button_context_settings_right_is_inc; | ||
426 | |||
427 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
428 | return button_context_colorchooser; | ||
429 | case CONTEXT_SETTINGS_EQ: | ||
430 | return button_context_eq; | ||
431 | |||
432 | case CONTEXT_SETTINGS_TIME: | ||
433 | return button_context_time; | ||
434 | |||
435 | case CONTEXT_YESNOSCREEN: | ||
436 | return button_context_yesno; | ||
437 | case CONTEXT_BOOKMARKSCREEN: | ||
438 | return button_context_bmark; | ||
439 | case CONTEXT_QUICKSCREEN: | ||
440 | return button_context_quickscreen; | ||
441 | case CONTEXT_PITCHSCREEN: | ||
442 | return button_context_pitchscreen; | ||
443 | case CONTEXT_KEYBOARD: | ||
444 | return button_context_keyboard; | ||
445 | #if CONFIG_TUNER | ||
446 | case CONTEXT_FM: | ||
447 | return button_context_radio; | ||
448 | #endif | ||
449 | #ifdef USB_ENABLE_HID | ||
450 | case CONTEXT_USB_HID: | ||
451 | return button_context_usb_hid; | ||
452 | case CONTEXT_USB_HID_MODE_MULTIMEDIA: | ||
453 | return button_context_usb_hid_mode_multimedia; | ||
454 | case CONTEXT_USB_HID_MODE_PRESENTATION: | ||
455 | return button_context_usb_hid_mode_presentation; | ||
456 | case CONTEXT_USB_HID_MODE_BROWSER: | ||
457 | return button_context_usb_hid_mode_browser; | ||
458 | #ifdef HAVE_USB_HID_MOUSE | ||
459 | case CONTEXT_USB_HID_MODE_MOUSE: | ||
460 | return button_context_usb_hid_mode_mouse; | ||
461 | #endif | ||
462 | #endif | ||
463 | } | ||
464 | return button_context_standard; | ||
465 | } | ||
diff --git a/bootloader/SOURCES b/bootloader/SOURCES index f3f751d374..19bc9591c2 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES | |||
@@ -12,9 +12,9 @@ gigabeat-s.c | |||
12 | #elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \ | 12 | #elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \ |
13 | defined(SANSA_E200) || defined(SANSA_C200) || \ | 13 | defined(SANSA_E200) || defined(SANSA_C200) || \ |
14 | defined(MROBE_100) || defined(PHILIPS_SA9200) || \ | 14 | defined(MROBE_100) || defined(PHILIPS_SA9200) || \ |
15 | defined(PHILIPS_HDD1630) || defined(SAMSUNG_YH820) || \ | 15 | defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) || \ |
16 | defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) || \ | 16 | defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || \ |
17 | defined(SANSA_VIEW) | 17 | defined(SAMSUNG_YH925) || defined(SANSA_VIEW) |
18 | #ifdef E200R_INSTALLER | 18 | #ifdef E200R_INSTALLER |
19 | main-e200r-installer.c | 19 | main-e200r-installer.c |
20 | #elif defined(C240_ERASE) | 20 | #elif defined(C240_ERASE) |
diff --git a/bootloader/common.c b/bootloader/common.c index bfe44a2687..0d66031ebf 100644 --- a/bootloader/common.c +++ b/bootloader/common.c | |||
@@ -40,9 +40,11 @@ | |||
40 | on a button press - currently only the ipod, H10 and Sansa versions do. */ | 40 | on a button press - currently only the ipod, H10 and Sansa versions do. */ |
41 | #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ | 41 | #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ |
42 | || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \ | 42 | || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \ |
43 | || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \ | 43 | || (CONFIG_CPU == AS3525) || defined(COWON_D2) \ |
44 | || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(MROBE_500) \ | 44 | || defined(MROBE_100) || defined(MROBE_500) \ |
45 | || defined(SAMSUNG_YH925) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH820) \ | 45 | || defined(SAMSUNG_YH925) || defined(SAMSUNG_YH920) \ |
46 | || defined(SAMSUNG_YH820) || defined(PHILIPS_SA9200) \ | ||
47 | || defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) \ | ||
46 | || defined(ONDA_VX747) | 48 | || defined(ONDA_VX747) |
47 | bool verbose = false; | 49 | bool verbose = false; |
48 | #else | 50 | #else |
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index ef0e199e3a..fe93f14eaa 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c | |||
@@ -75,6 +75,9 @@ extern int show_logo(void); | |||
75 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | 75 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD |
76 | #define BOOTLOADER_BOOT_OF BUTTON_MENU | 76 | #define BOOTLOADER_BOOT_OF BUTTON_MENU |
77 | 77 | ||
78 | #elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
79 | #define BOOTLOADER_BOOT_OF BUTTON_VOL_UP | ||
80 | |||
78 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | 81 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD |
79 | #define BOOTLOADER_BOOT_OF BUTTON_LEFT | 82 | #define BOOTLOADER_BOOT_OF BUTTON_LEFT |
80 | 83 | ||
@@ -603,7 +606,7 @@ void* main(void) | |||
603 | } | 606 | } |
604 | #endif | 607 | #endif |
605 | 608 | ||
606 | #if defined(PHILIPS_HDD1630) | 609 | #if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
607 | printf("Trying /System/OF.ebn"); | 610 | printf("Trying /System/OF.ebn"); |
608 | rc=load_mi4(loadbuffer, "/System/OF.ebn", MAX_LOADSIZE); | 611 | rc=load_mi4(loadbuffer, "/System/OF.ebn", MAX_LOADSIZE); |
609 | if (rc < EOK) { | 612 | if (rc < EOK) { |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 36f4c2762c..ee1b5c4dc9 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -636,17 +636,37 @@ target/arm/ata-pp5020.c | |||
636 | target/arm/wmcodec-pp.c | 636 | target/arm/wmcodec-pp.c |
637 | target/arm/i2s-pp.c | 637 | target/arm/i2s-pp.c |
638 | target/arm/adc-pp5020.c | 638 | target/arm/adc-pp5020.c |
639 | target/arm/philips/hdd1630/backlight-hdd1630.c | 639 | target/arm/philips/backlight-hdd.c |
640 | target/arm/philips/power-hdd.c | ||
641 | target/arm/philips/fmradio_i2c-hdd.c | ||
640 | target/arm/philips/hdd1630/button-hdd1630.c | 642 | target/arm/philips/hdd1630/button-hdd1630.c |
641 | target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c | ||
642 | target/arm/philips/hdd1630/lcd-hdd1630.c | 643 | target/arm/philips/hdd1630/lcd-hdd1630.c |
643 | target/arm/philips/hdd1630/lcd-as-hdd1630.S | 644 | target/arm/philips/hdd1630/lcd-as-hdd1630.S |
644 | target/arm/philips/hdd1630/power-hdd1630.c | ||
645 | target/arm/philips/hdd1630/powermgmt-hdd1630.c | 645 | target/arm/philips/hdd1630/powermgmt-hdd1630.c |
646 | target/arm/usb-fw-pp502x.c | 646 | target/arm/usb-fw-pp502x.c |
647 | #endif /* SIMULATOR */ | 647 | #endif /* SIMULATOR */ |
648 | #endif /* PHILIPS_HDD1630 */ | 648 | #endif /* PHILIPS_HDD1630 */ |
649 | 649 | ||
650 | #ifdef PHILIPS_HDD6330 | ||
651 | #ifndef SIMULATOR | ||
652 | #ifndef BOOTLOADER | ||
653 | drivers/synaptics-mep.c | ||
654 | #endif /* BOOTLOADER */ | ||
655 | target/arm/ata-as-arm.S | ||
656 | target/arm/ata-pp5020.c | ||
657 | target/arm/wmcodec-pp.c | ||
658 | target/arm/i2s-pp.c | ||
659 | target/arm/adc-pp5020.c | ||
660 | target/arm/philips/backlight-hdd.c | ||
661 | target/arm/philips/power-hdd.c | ||
662 | target/arm/philips/fmradio_i2c-hdd.c | ||
663 | target/arm/philips/hdd6330/button-hdd6330.c | ||
664 | target/arm/philips/hdd6330/lcd-hdd6330.c | ||
665 | target/arm/philips/hdd6330/powermgmt-hdd6330.c | ||
666 | target/arm/usb-fw-pp502x.c | ||
667 | #endif /* SIMULATOR */ | ||
668 | #endif /* PHILIPS_HDD6330 */ | ||
669 | |||
650 | #ifdef IAUDIO_X5 | 670 | #ifdef IAUDIO_X5 |
651 | #ifndef SIMULATOR | 671 | #ifndef SIMULATOR |
652 | target/coldfire/ata-as-coldfire.S | 672 | target/coldfire/ata-as-coldfire.S |
diff --git a/firmware/drivers/synaptics-mep.c b/firmware/drivers/synaptics-mep.c index a18f9e7fd6..937a5f64b1 100644 --- a/firmware/drivers/synaptics-mep.c +++ b/firmware/drivers/synaptics-mep.c | |||
@@ -53,7 +53,7 @@ | |||
53 | GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x4) | 53 | GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x4) |
54 | #define DATA_CL GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_EN, 0x4) | 54 | #define DATA_CL GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_EN, 0x4) |
55 | 55 | ||
56 | #elif defined(PHILIPS_HDD1630) | 56 | #elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
57 | #define INT_ENABLE GPIO_CLEAR_BITWISE(GPIOA_INT_LEV, 0x20);\ | 57 | #define INT_ENABLE GPIO_CLEAR_BITWISE(GPIOA_INT_LEV, 0x20);\ |
58 | GPIO_SET_BITWISE(GPIOA_INT_EN, 0x20) | 58 | GPIO_SET_BITWISE(GPIOA_INT_EN, 0x20) |
59 | #define INT_DISABLE GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x20);\ | 59 | #define INT_DISABLE GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x20);\ |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 114952e211..3997ce4b0c 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -114,6 +114,7 @@ | |||
114 | #define ONDAVX777_PAD 39 | 114 | #define ONDAVX777_PAD 39 |
115 | #define SAMSUNG_YPS3_PAD 40 | 115 | #define SAMSUNG_YPS3_PAD 40 |
116 | #define MINI2440_PAD 41 | 116 | #define MINI2440_PAD 41 |
117 | #define PHILIPS_HDD6330_PAD 42 | ||
117 | 118 | ||
118 | /* CONFIG_REMOTE_KEYPAD */ | 119 | /* CONFIG_REMOTE_KEYPAD */ |
119 | #define H100_REMOTE 1 | 120 | #define H100_REMOTE 1 |
@@ -194,6 +195,7 @@ | |||
194 | #define LCD_VIEW 35 /* as used by the Sansa View */ | 195 | #define LCD_VIEW 35 /* as used by the Sansa View */ |
195 | #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */ | 196 | #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */ |
196 | #define LCD_MINI2440 37 /* as used by the Mini2440 */ | 197 | #define LCD_MINI2440 37 /* as used by the Mini2440 */ |
198 | #define LCD_HDD6330 38 /* as used by the Philips HDD6330 */ | ||
197 | 199 | ||
198 | /* LCD_PIXELFORMAT */ | 200 | /* LCD_PIXELFORMAT */ |
199 | #define HORIZONTAL_PACKING 1 | 201 | #define HORIZONTAL_PACKING 1 |
@@ -359,6 +361,8 @@ Lyre prototype 1 */ | |||
359 | #include "config/gogearsa9200.h" | 361 | #include "config/gogearsa9200.h" |
360 | #elif defined(PHILIPS_HDD1630) | 362 | #elif defined(PHILIPS_HDD1630) |
361 | #include "config/gogearhdd1630.h" | 363 | #include "config/gogearhdd1630.h" |
364 | #elif defined(PHILIPS_HDD6330) | ||
365 | #include "config/gogearhdd6330.h" | ||
362 | #elif defined(SANSA_C100) | 366 | #elif defined(SANSA_C100) |
363 | #include "config/sansac100.h" | 367 | #include "config/sansac100.h" |
364 | #elif defined(MEIZU_M6SL) | 368 | #elif defined(MEIZU_M6SL) |
diff --git a/firmware/export/config/gogearhdd1630.h b/firmware/export/config/gogearhdd1630.h index c9a3b035ca..912ba427c0 100644 --- a/firmware/export/config/gogearhdd1630.h +++ b/firmware/export/config/gogearhdd1630.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * This config file is for the Philips GoGear HDD16x0/HDD63x0 | 2 | * This config file is for the Philips GoGear HDD16x0/HDD18x0 |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #define TARGET_TREE /* this target is using the target tree system */ | 5 | #define TARGET_TREE /* this target is using the target tree system */ |
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h new file mode 100644 index 0000000000..26da200ce1 --- /dev/null +++ b/firmware/export/config/gogearhdd6330.h | |||
@@ -0,0 +1,202 @@ | |||
1 | /* | ||
2 | * This config file is for the Philips GoGear HDD63x0 | ||
3 | */ | ||
4 | |||
5 | #define TARGET_TREE /* this target is using the target tree system */ | ||
6 | |||
7 | /* For Rolo and boot loader */ | ||
8 | #define MODEL_NUMBER 65 | ||
9 | #define MODEL_NAME "Philips GoGear HDD63x0" | ||
10 | |||
11 | /* define this if you use an ATA controller */ | ||
12 | #define CONFIG_STORAGE STORAGE_ATA | ||
13 | |||
14 | /* define this if you have recording possibility */ | ||
15 | #define HAVE_RECORDING | ||
16 | |||
17 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
18 | explicitly if different */ | ||
19 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) | ||
20 | |||
21 | /* define the bitmask of hardware sample rates */ | ||
22 | #define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \ | ||
23 | SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) | ||
24 | |||
25 | /* define the bitmask of recording sample rates */ | ||
26 | #define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \ | ||
27 | SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) | ||
28 | |||
29 | /* define this if you have a bitmap LCD display */ | ||
30 | #define HAVE_LCD_BITMAP | ||
31 | |||
32 | /* define this if you have a colour LCD */ | ||
33 | #define HAVE_LCD_COLOR | ||
34 | |||
35 | /* define this if you want album art for this target */ | ||
36 | #define HAVE_ALBUMART | ||
37 | |||
38 | /* define this to enable bitmap scaling */ | ||
39 | #define HAVE_BMP_SCALING | ||
40 | |||
41 | /* define this to enable JPEG decoding */ | ||
42 | #define HAVE_JPEG | ||
43 | |||
44 | /* define this if you have access to the quickscreen */ | ||
45 | #define HAVE_QUICKSCREEN | ||
46 | |||
47 | /* define this if you have access to the pitchscreen */ | ||
48 | #define HAVE_PITCHSCREEN | ||
49 | |||
50 | /* define this if you would like tagcache to build on this target */ | ||
51 | #define HAVE_TAGCACHE | ||
52 | |||
53 | /* LCD dimensions */ | ||
54 | #define LCD_WIDTH 220 | ||
55 | #define LCD_HEIGHT 176 | ||
56 | #define LCD_DEPTH 16 /* 65536 colours */ | ||
57 | #define LCD_PIXELFORMAT RGB565 /* rgb565 byte-swapped */ | ||
58 | |||
59 | #ifndef BOOTLOADER | ||
60 | /* Define this if your LCD can be enabled/disabled */ | ||
61 | /* #define HAVE_LCD_ENABLE */ | ||
62 | |||
63 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
64 | * should be defined as well. | ||
65 | * We can currently put the lcd to sleep but it won't wake up properly */ | ||
66 | /* #define HAVE_LCD_SLEEP */ | ||
67 | /* #define HAVE_LCD_SLEEP_SETTING */ | ||
68 | #endif | ||
69 | |||
70 | /* define this if you can flip your LCD */ | ||
71 | /* #define HAVE_LCD_FLIP */ | ||
72 | |||
73 | /* define this if you can invert the colours on your LCD */ | ||
74 | /* #define HAVE_LCD_INVERT */ | ||
75 | |||
76 | /* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ | ||
77 | |||
78 | #define CONFIG_KEYPAD PHILIPS_HDD6330_PAD | ||
79 | |||
80 | /* Define this to enable morse code input */ | ||
81 | #define HAVE_MORSE_INPUT | ||
82 | |||
83 | /* define this if the target has volume keys which can be used in the lists */ | ||
84 | #define HAVE_VOLUME_IN_LIST | ||
85 | |||
86 | /* Define this if you do software codec */ | ||
87 | #define CONFIG_CODEC SWCODEC | ||
88 | |||
89 | /* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC, | ||
90 | but it's register compatible with the E8564. */ | ||
91 | #ifndef BOOTLOADER | ||
92 | #define CONFIG_RTC RTC_E8564 | ||
93 | #define HAVE_RTC_ALARM | ||
94 | #endif | ||
95 | |||
96 | /* Define this if you have a software controlled poweroff */ | ||
97 | #define HAVE_SW_POWEROFF | ||
98 | |||
99 | /* The number of bytes reserved for loadable codecs */ | ||
100 | #define CODEC_SIZE 0x100000 | ||
101 | |||
102 | /* The number of bytes reserved for loadable plugins */ | ||
103 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
104 | |||
105 | /* Define this if you have the WM8731 audio codec */ | ||
106 | #define HAVE_WM8731 | ||
107 | |||
108 | /* WM8731 has no tone controls, so we use the software ones */ | ||
109 | #define HAVE_SW_TONE_CONTROLS | ||
110 | |||
111 | /* TODO: #define AB_REPEAT_ENABLE 1 */ | ||
112 | |||
113 | /* FM Tuner */ | ||
114 | #define CONFIG_TUNER TEA5767 | ||
115 | #define CONFIG_TUNER_XTAL 32768 | ||
116 | |||
117 | /* define this if you have a disk storage, i.e. something | ||
118 | that needs spinups and can cause skips when shaked */ | ||
119 | #define HAVE_DISK_STORAGE | ||
120 | |||
121 | /* Define this for LCD backlight available */ | ||
122 | #define HAVE_BACKLIGHT | ||
123 | #define HAVE_BACKLIGHT_BRIGHTNESS | ||
124 | /* #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING */ | ||
125 | |||
126 | /* Main LCD backlight brightness range and defaults */ | ||
127 | #define MIN_BRIGHTNESS_SETTING 1 | ||
128 | #define MAX_BRIGHTNESS_SETTING 16 | ||
129 | #define DEFAULT_BRIGHTNESS_SETTING 13 /* match OF brightness */ | ||
130 | |||
131 | /* define this if you have a light associated with the buttons */ | ||
132 | #define HAVE_BUTTON_LIGHT | ||
133 | #define HAVE_BUTTONLIGHT_BRIGHTNESS | ||
134 | |||
135 | #define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */ | ||
136 | #define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */ | ||
137 | #define BATTERY_CAPACITY_MAX 630 /* max. capacity selectable */ | ||
138 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | ||
139 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
140 | |||
141 | /* Hardware controlled charging */ | ||
142 | #define CONFIG_CHARGING CHARGING_SIMPLE | ||
143 | |||
144 | /* define this if the unit can be powered or charged via USB */ | ||
145 | #define HAVE_USB_POWER | ||
146 | |||
147 | /* Define this if you have a PortalPlayer PP5020 */ | ||
148 | #define CONFIG_CPU PP5022 | ||
149 | |||
150 | /* Define this if you want to use the PP5020 i2c interface */ | ||
151 | #define CONFIG_I2C I2C_PP5020 | ||
152 | |||
153 | /* define this if the hardware can be powered off while charging */ | ||
154 | #define HAVE_POWEROFF_WHILE_CHARGING | ||
155 | |||
156 | /* The start address index for ROM builds */ | ||
157 | #define ROM_START 0x00000000 | ||
158 | |||
159 | /* The size of the flash ROM */ | ||
160 | #define FLASH_SIZE 0x100000 | ||
161 | |||
162 | /* Define this to the CPU frequency */ | ||
163 | #define CPU_FREQ 75000000 | ||
164 | |||
165 | /* Type of LCD */ | ||
166 | #define CONFIG_LCD LCD_HDD6330 | ||
167 | |||
168 | /* Define this if your LCD can set contrast */ | ||
169 | /* #define HAVE_LCD_CONTRAST */ | ||
170 | |||
171 | #define MIN_CONTRAST_SETTING 0 | ||
172 | #define MAX_CONTRAST_SETTING 127 | ||
173 | #define DEFAULT_CONTRAST_SETTING 63 /* Match boot contrast */ | ||
174 | |||
175 | /* We're able to shut off power to the HDD */ | ||
176 | #define HAVE_ATA_POWER_OFF | ||
177 | |||
178 | /* Offset ( in the firmware file's header ) to the file CRC and data. These are | ||
179 | only used when loading the old format rockbox.e200 file */ | ||
180 | #define FIRMWARE_OFFSET_FILE_CRC 0x0 | ||
181 | #define FIRMWARE_OFFSET_FILE_DATA 0x8 | ||
182 | |||
183 | /* USB On-the-go */ | ||
184 | #define CONFIG_USBOTG USBOTG_ARC | ||
185 | |||
186 | /* enable these for the experimental usb stack */ | ||
187 | #define HAVE_USBSTACK | ||
188 | #define USE_ROCKBOX_USB | ||
189 | #define USB_VENDOR_ID 0x0471 | ||
190 | #define USB_PRODUCT_ID 0x014C | ||
191 | #define HAVE_USB_HID_MOUSE | ||
192 | |||
193 | /* Define this if you have adjustable CPU frequency */ | ||
194 | #define HAVE_ADJUSTABLE_CPU_FREQ | ||
195 | |||
196 | #define MI4_FORMAT | ||
197 | #define BOOTFILE_EXT "mi4" | ||
198 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
199 | #define BOOTDIR "/.rockbox" | ||
200 | |||
201 | #define ICODE_ATTR_TREMOR_NOT_MDCT | ||
202 | |||
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 42c0a93016..59c0004416 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h | |||
@@ -86,6 +86,9 @@ enum { | |||
86 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD | 86 | #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD |
87 | #define USBPOWER_BUTTON BUTTON_PLAYLIST | 87 | #define USBPOWER_BUTTON BUTTON_PLAYLIST |
88 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | 88 | #define USBPOWER_BTN_IGNORE BUTTON_POWER |
89 | #elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD | ||
90 | #define USBPOWER_BUTTON BUTTON_SELECT | ||
91 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | ||
89 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | 92 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD |
90 | #define USBPOWER_BUTTON BUTTON_RIGHT | 93 | #define USBPOWER_BUTTON BUTTON_RIGHT |
91 | #define USBPOWER_BTN_IGNORE BUTTON_LEFT | 94 | #define USBPOWER_BTN_IGNORE BUTTON_LEFT |
diff --git a/firmware/target/arm/adc-pp5020.c b/firmware/target/arm/adc-pp5020.c index 851e907246..d4b4ff5b02 100644 --- a/firmware/target/arm/adc-pp5020.c +++ b/firmware/target/arm/adc-pp5020.c | |||
@@ -59,7 +59,7 @@ unsigned short adc_scan(int channel) | |||
59 | 59 | ||
60 | adcdata[channel] = (adc_data_1<<2 | adc_data_2); | 60 | adcdata[channel] = (adc_data_1<<2 | adc_data_2); |
61 | 61 | ||
62 | #if !defined(PHILIPS_HDD1630) | 62 | #if !(defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)) |
63 | /* ADC values read low if PLL is enabled */ | 63 | /* ADC values read low if PLL is enabled */ |
64 | if(PLL_CONTROL & 0x80000000){ | 64 | if(PLL_CONTROL & 0x80000000){ |
65 | adcdata[channel] += 0x14; | 65 | adcdata[channel] += 0x14; |
@@ -94,7 +94,7 @@ static void adc_tick(void) | |||
94 | /* Figured out from how the OF does things */ | 94 | /* Figured out from how the OF does things */ |
95 | void adc_init(void) | 95 | void adc_init(void) |
96 | { | 96 | { |
97 | #if defined(PHILIPS_HDD1630) | 97 | #if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
98 | ADC_INIT = 0; | 98 | ADC_INIT = 0; |
99 | #else | 99 | #else |
100 | ADC_INIT |= 1; | 100 | ADC_INIT |= 1; |
@@ -119,7 +119,7 @@ void adc_init(void) | |||
119 | ADC_ADDR = 0; | 119 | ADC_ADDR = 0; |
120 | ADC_ADDR |= 0x40; | 120 | ADC_ADDR |= 0x40; |
121 | 121 | ||
122 | #if !defined(PHILIPS_HDD1630) | 122 | #if !(defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)) |
123 | ADC_ADDR |= 0x20000000; | 123 | ADC_ADDR |= 0x20000000; |
124 | udelay(100); | 124 | udelay(100); |
125 | 125 | ||
@@ -155,7 +155,7 @@ void adc_init(void) | |||
155 | ADC_STATUS |= 0x20000000; | 155 | ADC_STATUS |= 0x20000000; |
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | #if defined(PHILIPS_HDD1630) | 158 | #if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
159 | ADC_INIT |= 0x80000000; | 159 | ADC_INIT |= 0x80000000; |
160 | udelay(100); | 160 | udelay(100); |
161 | ADC_INIT = 0; | 161 | ADC_INIT = 0; |
diff --git a/firmware/target/arm/crt0-pp-bl.S b/firmware/target/arm/crt0-pp-bl.S index 1d2909e7f4..79235a6371 100644 --- a/firmware/target/arm/crt0-pp-bl.S +++ b/firmware/target/arm/crt0-pp-bl.S | |||
@@ -156,7 +156,7 @@ cpu: | |||
156 | mov r1, #WAKE | 156 | mov r1, #WAKE |
157 | str r1, [r0] | 157 | str r1, [r0] |
158 | 158 | ||
159 | #if defined(SANSA_C200) || defined(PHILIPS_HDD1630) | 159 | #if defined(SANSA_C200) || defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
160 | /* Magic for loading the c200 OF */ | 160 | /* Magic for loading the c200 OF */ |
161 | ldr r0, =0xb00d10ad | 161 | ldr r0, =0xb00d10ad |
162 | mov r1, #0x700 | 162 | mov r1, #0x700 |
diff --git a/firmware/target/arm/i2c-pp.c b/firmware/target/arm/i2c-pp.c index 60497b04b9..9b92e3b8f1 100644 --- a/firmware/target/arm/i2c-pp.c +++ b/firmware/target/arm/i2c-pp.c | |||
@@ -269,8 +269,8 @@ void i2c_init(void) | |||
269 | 269 | ||
270 | #if CONFIG_I2C == I2C_PP5020 | 270 | #if CONFIG_I2C == I2C_PP5020 |
271 | outl(0x0, 0x600060a4); | 271 | outl(0x0, 0x600060a4); |
272 | #if defined(PHILIPS_HDD1630) || defined(SAMSUNG_YH820) || \ | 272 | #if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) || \ |
273 | defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) | 273 | defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) |
274 | outl(inl(0x600060a4) | 0x20, 0x600060a4); | 274 | outl(inl(0x600060a4) | 0x20, 0x600060a4); |
275 | outl(inl(0x7000c020) | 0x3, 0x7000c020); | 275 | outl(inl(0x7000c020) | 0x3, 0x7000c020); |
276 | outl(0x55, 0x7000c02c); | 276 | outl(0x55, 0x7000c02c); |
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/backlight-hdd.c index cc8f04dda9..cc8f04dda9 100644 --- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c +++ b/firmware/target/arm/philips/backlight-hdd.c | |||
diff --git a/firmware/target/arm/philips/hdd1630/backlight-target.h b/firmware/target/arm/philips/backlight-target.h index c7aca54a23..c7aca54a23 100644 --- a/firmware/target/arm/philips/hdd1630/backlight-target.h +++ b/firmware/target/arm/philips/backlight-target.h | |||
diff --git a/firmware/target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c b/firmware/target/arm/philips/fmradio_i2c-hdd.c index 98fe5f64ab..98fe5f64ab 100644 --- a/firmware/target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c +++ b/firmware/target/arm/philips/fmradio_i2c-hdd.c | |||
diff --git a/firmware/target/arm/philips/hdd6330/adc-target.h b/firmware/target/arm/philips/hdd6330/adc-target.h new file mode 100644 index 0000000000..bf97081e35 --- /dev/null +++ b/firmware/target/arm/philips/hdd6330/adc-target.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef _ADC_TARGET_H_ | ||
22 | #define _ADC_TARGET_H_ | ||
23 | |||
24 | #define NUM_ADC_CHANNELS 2 | ||
25 | |||
26 | #define ADC_BATTERY 0 | ||
27 | #define ADC_UNKNOWN_1 1 | ||
28 | #define ADC_UNKNOWN_2 2 | ||
29 | #define ADC_UNKNOWN_3 3 | ||
30 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | ||
31 | |||
32 | /* Force a scan now */ | ||
33 | unsigned short adc_scan(int channel); | ||
34 | |||
35 | #endif | ||
diff --git a/firmware/target/arm/philips/hdd6330/button-hdd6330.c b/firmware/target/arm/philips/hdd6330/button-hdd6330.c new file mode 100644 index 0000000000..ab06c0cf1a --- /dev/null +++ b/firmware/target/arm/philips/hdd6330/button-hdd6330.c | |||
@@ -0,0 +1,125 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "system.h" | ||
23 | #include "button.h" | ||
24 | #include "backlight.h" | ||
25 | #include "synaptics-mep.h" | ||
26 | |||
27 | /*#define LOGF_ENABLE*/ | ||
28 | #include "logf.h" | ||
29 | |||
30 | static int int_btn = BUTTON_NONE; | ||
31 | |||
32 | /* | ||
33 | * Generate a click sound from the player (not in headphones yet) | ||
34 | * TODO: integrate this with the "key click" option | ||
35 | */ | ||
36 | void button_click(void) | ||
37 | { | ||
38 | GPO32_ENABLE |= 0x2000; | ||
39 | GPO32_VAL |= 0x2000; | ||
40 | udelay(1000); | ||
41 | GPO32_VAL &= ~0x2000; | ||
42 | } | ||
43 | |||
44 | #ifndef BOOTLOADER | ||
45 | void button_init_device(void) | ||
46 | { | ||
47 | /* The touchpad is powered on and initialized in power-hdd1630.c | ||
48 | since it needs to be ready for both buttons and button lights. */ | ||
49 | } | ||
50 | |||
51 | /* | ||
52 | * Button interrupt handler | ||
53 | */ | ||
54 | void button_int(void) | ||
55 | { | ||
56 | char data[4]; | ||
57 | int val; | ||
58 | |||
59 | int_btn = BUTTON_NONE; | ||
60 | |||
61 | val = touchpad_read_device(data, 4); | ||
62 | |||
63 | if (val == MEP_BUTTON_HEADER) | ||
64 | { | ||
65 | /* Buttons packet */ | ||
66 | if (data[1] & 0x1) | ||
67 | int_btn |= BUTTON_LEFT; | ||
68 | if (data[1] & 0x2) | ||
69 | int_btn |= BUTTON_RIGHT; | ||
70 | } | ||
71 | else if (val == MEP_ABSOLUTE_HEADER) | ||
72 | { | ||
73 | /* Absolute packet - the finger is on the vertical strip. | ||
74 | Position ranges from 1-4095, with 1 at the bottom. */ | ||
75 | val = ((data[1] >> 4) << 8) | data[2]; /* position */ | ||
76 | |||
77 | if ((val > 0) && (val <= 1365)) | ||
78 | int_btn |= BUTTON_DOWN; | ||
79 | else if ((val > 1365) && (val <= 2730)) | ||
80 | int_btn |= BUTTON_SELECT; | ||
81 | else if ((val > 2730) && (val <= 4095)) | ||
82 | int_btn |= BUTTON_UP; | ||
83 | } | ||
84 | } | ||
85 | #else | ||
86 | void button_init_device(void){} | ||
87 | #endif /* bootloader */ | ||
88 | |||
89 | bool button_hold(void) | ||
90 | { | ||
91 | return !(GPIOJ_INPUT_VAL & 0x8); | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * Get button pressed from hardware | ||
96 | */ | ||
97 | int button_read_device(void) | ||
98 | { | ||
99 | static int btn_old = BUTTON_NONE; | ||
100 | int btn = int_btn; | ||
101 | |||
102 | /* Hold */ | ||
103 | if(button_hold()) | ||
104 | return BUTTON_NONE; | ||
105 | |||
106 | /* Device buttons */ | ||
107 | if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_MENU; | ||
108 | if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_VOL_UP; | ||
109 | if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; | ||
110 | if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_VIEW; | ||
111 | if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST; | ||
112 | if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER; | ||
113 | |||
114 | if ((btn != btn_old) && (btn != BUTTON_NONE)) | ||
115 | button_click(); | ||
116 | |||
117 | btn_old = btn; | ||
118 | |||
119 | return btn; | ||
120 | } | ||
121 | |||
122 | bool headphones_inserted(void) | ||
123 | { | ||
124 | return (GPIOE_INPUT_VAL & 0x80) ? true : false; | ||
125 | } | ||
diff --git a/firmware/target/arm/philips/hdd6330/button-target.h b/firmware/target/arm/philips/hdd6330/button-target.h new file mode 100644 index 0000000000..b7fc21aca2 --- /dev/null +++ b/firmware/target/arm/philips/hdd6330/button-target.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _BUTTON_TARGET_H_ | ||
23 | #define _BUTTON_TARGET_H_ | ||
24 | |||
25 | #include <stdbool.h> | ||
26 | #include "config.h" | ||
27 | |||
28 | #define MEP_BUTTON_HEADER 0x19 | ||
29 | #define MEP_BUTTON_ID 0x9 | ||
30 | #define MEP_ABSOLUTE_HEADER 0x0b | ||
31 | |||
32 | #define HAS_BUTTON_HOLD | ||
33 | |||
34 | bool button_hold(void); | ||
35 | void button_init_device(void); | ||
36 | int button_read_device(void); | ||
37 | |||
38 | #ifndef BOOTLOADER | ||
39 | void button_int(void); | ||
40 | #endif | ||
41 | |||
42 | /* Main unit's buttons */ | ||
43 | #define BUTTON_POWER 0x00000001 | ||
44 | #define BUTTON_PLAYLIST 0x00000002 | ||
45 | #define BUTTON_MENU 0x00000004 | ||
46 | #define BUTTON_VIEW 0x00000008 | ||
47 | #define BUTTON_VOL_UP 0x00000010 | ||
48 | #define BUTTON_VOL_DOWN 0x00000020 | ||
49 | #define BUTTON_SELECT 0x00000040 | ||
50 | #define BUTTON_LEFT 0x00000080 | ||
51 | #define BUTTON_RIGHT 0x00000100 | ||
52 | #define BUTTON_UP 0x00000200 | ||
53 | #define BUTTON_DOWN 0x00000400 | ||
54 | |||
55 | #define BUTTON_MAIN 0x00000fff | ||
56 | |||
57 | /* No Remote control */ | ||
58 | #define BUTTON_REMOTE 0 | ||
59 | |||
60 | #define POWEROFF_BUTTON BUTTON_POWER | ||
61 | #define POWEROFF_COUNT 10 | ||
62 | |||
63 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c new file mode 100644 index 0000000000..3d9cb036f1 --- /dev/null +++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c | |||
@@ -0,0 +1,159 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "cpu.h" | ||
23 | #include "lcd.h" | ||
24 | #include "kernel.h" | ||
25 | #include "system.h" | ||
26 | |||
27 | /* Display status */ | ||
28 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | ||
29 | |||
30 | /* wait for LCD */ | ||
31 | static inline void lcd_wait_write(void) | ||
32 | { | ||
33 | int i = 0; | ||
34 | while (LCD2_PORT & LCD2_BUSY_MASK) | ||
35 | { | ||
36 | if (i < 2000) | ||
37 | i++; | ||
38 | else | ||
39 | LCD2_PORT &= ~LCD2_BUSY_MASK; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /* send LCD data */ | ||
44 | static void lcd_send_data(unsigned data) | ||
45 | { | ||
46 | lcd_wait_write(); | ||
47 | LCD2_PORT = LCD2_DATA_MASK | (data & 0xff); | ||
48 | } | ||
49 | |||
50 | /* send LCD command */ | ||
51 | static void lcd_send_cmd(unsigned cmd) | ||
52 | { | ||
53 | lcd_wait_write(); | ||
54 | LCD2_PORT = LCD2_CMD_MASK | (cmd & 0xff); | ||
55 | lcd_wait_write(); | ||
56 | } | ||
57 | |||
58 | static inline void lcd_send_pixel(unsigned pixel) | ||
59 | { | ||
60 | lcd_send_data(pixel >> 8); | ||
61 | lcd_send_data(pixel); | ||
62 | } | ||
63 | |||
64 | void lcd_init_device(void) | ||
65 | { | ||
66 | /* init handled by the OF bootloader */ | ||
67 | } | ||
68 | |||
69 | /*** hardware configuration ***/ | ||
70 | int lcd_default_contrast(void) | ||
71 | { | ||
72 | return DEFAULT_CONTRAST_SETTING; | ||
73 | } | ||
74 | |||
75 | void lcd_set_contrast(int val) | ||
76 | { | ||
77 | (void)val; | ||
78 | } | ||
79 | |||
80 | void lcd_set_invert_display(bool yesno) | ||
81 | { | ||
82 | (void)yesno; | ||
83 | } | ||
84 | |||
85 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
86 | void lcd_set_flip(bool yesno) | ||
87 | { | ||
88 | (void)yesno; | ||
89 | } | ||
90 | |||
91 | void lcd_yuv_set_options(unsigned options) | ||
92 | { | ||
93 | lcd_yuv_options = options; | ||
94 | } | ||
95 | |||
96 | /* Performance function to blit a YUV bitmap directly to the LCD */ | ||
97 | void lcd_blit_yuv(unsigned char * const src[3], | ||
98 | int src_x, int src_y, int stride, | ||
99 | int x, int y, int width, int height) | ||
100 | { | ||
101 | (void)src; | ||
102 | (void)src_x; | ||
103 | (void)src_y; | ||
104 | (void)stride; | ||
105 | (void)x; | ||
106 | (void)y; | ||
107 | (void)width; | ||
108 | (void)height; | ||
109 | } | ||
110 | |||
111 | /* Update the display. | ||
112 | This must be called after all other LCD functions that change the display. */ | ||
113 | void lcd_update(void) | ||
114 | { | ||
115 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); | ||
116 | } | ||
117 | |||
118 | /* Update a fraction of the display. */ | ||
119 | void lcd_update_rect(int x, int y, int width, int height) | ||
120 | { | ||
121 | const fb_data *addr; | ||
122 | |||
123 | if (x + width >= LCD_WIDTH) | ||
124 | width = LCD_WIDTH - x; | ||
125 | if (y + height >= LCD_HEIGHT) | ||
126 | height = LCD_HEIGHT - y; | ||
127 | |||
128 | if ((width <= 0) || (height <= 0)) | ||
129 | return; /* Nothing left to do. */ | ||
130 | |||
131 | addr = &lcd_framebuffer[y][x]; | ||
132 | |||
133 | lcd_send_cmd(0x01); | ||
134 | lcd_send_data(0x48); | ||
135 | |||
136 | lcd_send_cmd(0x05); | ||
137 | lcd_send_data(0x0f); | ||
138 | |||
139 | lcd_send_cmd(0x08); | ||
140 | lcd_send_data(y); | ||
141 | |||
142 | lcd_send_cmd(0x09); | ||
143 | lcd_send_data(y + height - 1); | ||
144 | |||
145 | lcd_send_cmd(0x0a); | ||
146 | lcd_send_data(x + 16); | ||
147 | |||
148 | lcd_send_cmd(0x0b); | ||
149 | lcd_send_data(x + width - 1 + 16); | ||
150 | |||
151 | lcd_send_cmd(0x06); | ||
152 | do { | ||
153 | int w = width; | ||
154 | do { | ||
155 | lcd_send_pixel(*addr++); | ||
156 | } while (--w > 0); | ||
157 | addr += LCD_WIDTH - width; | ||
158 | } while (--height > 0); | ||
159 | } | ||
diff --git a/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c new file mode 100644 index 0000000000..33bbb6af48 --- /dev/null +++ b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese | ||
11 | * Revisions copyright (C) 2005 by Gerald Van Baren | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | |||
23 | #include "config.h" | ||
24 | #include "adc.h" | ||
25 | #include "powermgmt.h" | ||
26 | |||
27 | #define SMLAL(lo, hi, x, y) \ | ||
28 | asm volatile ("smlal %0, %1, %2, %3" \ | ||
29 | : "+r" (lo), "+r" (hi) \ | ||
30 | : "%r" (x), "r" (y)) | ||
31 | |||
32 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
33 | { | ||
34 | 3550 | ||
35 | }; | ||
36 | |||
37 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
38 | { | ||
39 | 3500 | ||
40 | }; | ||
41 | |||
42 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
43 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | ||
44 | { | ||
45 | { 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 }, | ||
46 | }; | ||
47 | |||
48 | #if CONFIG_CHARGING | ||
49 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | ||
50 | const unsigned short percent_to_volt_charge[11] = | ||
51 | { | ||
52 | 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 | ||
53 | }; | ||
54 | #endif /* CONFIG_CHARGING */ | ||
55 | |||
56 | #define BATTERY_SCALE_FACTOR 4200 | ||
57 | /* full-scale ADC readout (2^10) in millivolt */ | ||
58 | |||
59 | /* Returns battery voltage from ADC [millivolts] */ | ||
60 | unsigned int battery_adc_voltage(void) | ||
61 | { | ||
62 | /* return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; */ | ||
63 | |||
64 | /* This may be overly complicated (pulled from the OF) */ | ||
65 | int lo = 0; | ||
66 | int val = adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR; | ||
67 | |||
68 | SMLAL(lo, val, 0x8a42f871, val); | ||
69 | val>>= 9; | ||
70 | val -= (val >> 31); | ||
71 | return val; | ||
72 | } | ||
diff --git a/firmware/target/arm/philips/hdd1630/power-hdd1630.c b/firmware/target/arm/philips/power-hdd.c index c348567529..c348567529 100644 --- a/firmware/target/arm/philips/hdd1630/power-hdd1630.c +++ b/firmware/target/arm/philips/power-hdd.c | |||
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c index 61d4d7cb59..e2604e7633 100644 --- a/firmware/target/arm/system-pp502x.c +++ b/firmware/target/arm/system-pp502x.c | |||
@@ -143,7 +143,7 @@ void __attribute__((interrupt("IRQ"))) irq_handler(void) | |||
143 | usb_insert_int(); | 143 | usb_insert_int(); |
144 | } | 144 | } |
145 | /* end PHILIPS_SA9200 */ | 145 | /* end PHILIPS_SA9200 */ |
146 | #elif defined(PHILIPS_HDD1630) | 146 | #elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
147 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { | 147 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { |
148 | if (GPIOA_INT_STAT & 0x20) | 148 | if (GPIOA_INT_STAT & 0x20) |
149 | button_int(); | 149 | button_int(); |
@@ -152,7 +152,7 @@ void __attribute__((interrupt("IRQ"))) irq_handler(void) | |||
152 | if (GPIOE_INT_STAT & 0x04) | 152 | if (GPIOE_INT_STAT & 0x04) |
153 | usb_insert_int(); | 153 | usb_insert_int(); |
154 | } | 154 | } |
155 | /* end PHILIPS_HDD1630 */ | 155 | /* end PHILIPS_HDD1630 || PHILIPS_HDD6330 */ |
156 | #elif defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) | 156 | #elif defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) |
157 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { | 157 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { |
158 | if (GPIOD_INT_STAT & 0x10) | 158 | if (GPIOD_INT_STAT & 0x10) |
diff --git a/firmware/target/arm/usb-fw-pp502x.c b/firmware/target/arm/usb-fw-pp502x.c index e234e61031..bc15dc208d 100644 --- a/firmware/target/arm/usb-fw-pp502x.c +++ b/firmware/target/arm/usb-fw-pp502x.c | |||
@@ -70,7 +70,7 @@ | |||
70 | #define USB_GPIO_MASK 0x80 | 70 | #define USB_GPIO_MASK 0x80 |
71 | #define USB_GPIO_VAL 0x00 | 71 | #define USB_GPIO_VAL 0x00 |
72 | 72 | ||
73 | #elif defined(PHILIPS_HDD1630) | 73 | #elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) |
74 | /* GPIO E bit 2 is usb detect */ | 74 | /* GPIO E bit 2 is usb detect */ |
75 | #define USB_GPIO GPIOE | 75 | #define USB_GPIO GPIOE |
76 | #define USB_GPIO_MASK 0x04 | 76 | #define USB_GPIO_MASK 0x04 |
diff --git a/tools/configure b/tools/configure index dbbc4252d8..dee6bbfe09 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -894,12 +894,12 @@ cat <<EOF | |||
894 | 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip | 894 | 90) Zen Vision:M 30GB 100) GoGear SA9200 55) Sansa Clip |
895 | 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2 | 895 | 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 56) Sansa e200v2 |
896 | 92) Zen Vision HDD1830 57) Sansa m200v4 | 896 | 92) Zen Vision HDD1830 57) Sansa m200v4 |
897 | 58) Sansa Fuze | 897 | 102) GoGear HDD6330 58) Sansa Fuze |
898 | ==Onda== ==Meizu== 59) Sansa c200v2 | 898 | ==Onda== 59) Sansa c200v2 |
899 | 120) VX747 110) M6SL 60) Sansa Clipv2 | 899 | 120) VX747 ==Meizu== 60) Sansa Clipv2 |
900 | 121) VX767 111) M6SP 61) Sansa View | 900 | 121) VX767 110) M6SL 61) Sansa View |
901 | 122) VX747+ 112) M3 | 901 | 122) VX747+ 111) M6SP |
902 | 123) VX777 ==Logik== | 902 | 123) VX777 112) M3 ==Logik== |
903 | 80) DAX 1GB MP3/DAB | 903 | 80) DAX 1GB MP3/DAB |
904 | ==Samsung== ==Tatung== | 904 | ==Samsung== ==Tatung== |
905 | 140) YH-820 150) Elio TPJ-1022 ==Lyre project== | 905 | 140) YH-820 150) Elio TPJ-1022 ==Lyre project== |
@@ -2120,6 +2120,30 @@ fi | |||
2120 | t_model="hdd1630" | 2120 | t_model="hdd1630" |
2121 | ;; | 2121 | ;; |
2122 | 2122 | ||
2123 | 102|gogearhdd6330) | ||
2124 | target_id=65 | ||
2125 | modelname="gogearhdd6330" | ||
2126 | target="-DPHILIPS_HDD6330" | ||
2127 | memory=32 # supposedly | ||
2128 | arm7tdmicc | ||
2129 | tool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBOS" | ||
2130 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
2131 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
2132 | output="rockbox.mi4" | ||
2133 | appextra="recorder:gui" | ||
2134 | plugins="" | ||
2135 | swcodec="yes" | ||
2136 | boottool="$rootdir/tools/scramble -mi4v3 -model=6330 -type=RBBL" | ||
2137 | bootoutput="FWImage.ebn" | ||
2138 | # toolset is the tools within the tools directory that we build for | ||
2139 | # this particular target. | ||
2140 | toolset=$scramblebitmaptools | ||
2141 | # architecture, manufacturer and model for the target-tree build | ||
2142 | t_cpu="arm" | ||
2143 | t_manufacturer="philips" | ||
2144 | t_model="hdd6330" | ||
2145 | ;; | ||
2146 | |||
2123 | 110|meizum6sl) | 2147 | 110|meizum6sl) |
2124 | target_id=49 | 2148 | target_id=49 |
2125 | modelname="meizum6sl" | 2149 | modelname="meizum6sl" |
diff --git a/tools/scramble.c b/tools/scramble.c index c9b6d15dd4..9bfdbda905 100644 --- a/tools/scramble.c +++ b/tools/scramble.c | |||
@@ -123,9 +123,9 @@ void usage(void) | |||
123 | "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n" | 123 | "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n" |
124 | "\t ip3g, ip4g, mini, iax5, iam5, iam3, h10, h10_5gb,\n" | 124 | "\t ip3g, ip4g, mini, iax5, iam5, iam3, h10, h10_5gb,\n" |
125 | "\t tpj2, c200, e200, giga, gigs, m100, m500, d2,\n"); | 125 | "\t tpj2, c200, e200, giga, gigs, m100, m500, d2,\n"); |
126 | printf("\t 9200, 1630, ldax, m200, c100, clip, e2v2, m2v4,\n" | 126 | printf("\t 9200, 1630, 6330, ldax, m200, c100, clip, e2v2,\n" |
127 | "\t fuze, c2v2, clv2, y820, y920, y925, x747, 747p, \n" | 127 | "\t m2v4, fuze, c2v2, clv2, y820, y920, y925, x747,\n" |
128 | "\t x777, nn2g, m244)\n"); | 128 | "\t 747p, x777, nn2g, m244)\n"); |
129 | printf("\nNo option results in Archos standard player/recorder format.\n"); | 129 | printf("\nNo option results in Archos standard player/recorder format.\n"); |
130 | 130 | ||
131 | exit(1); | 131 | exit(1); |
@@ -318,6 +318,8 @@ int main (int argc, char** argv) | |||
318 | modelnum = 62; | 318 | modelnum = 62; |
319 | else if (!strcmp(&argv[1][5], "x767")) | 319 | else if (!strcmp(&argv[1][5], "x767")) |
320 | modelnum = 64; | 320 | modelnum = 64; |
321 | else if (!strcmp(&argv[1][5], "6330")) /* Philips HDD6330 */ | ||
322 | modelnum = 65; | ||
321 | else if (!strcmp(&argv[1][5], "m244")) | 323 | else if (!strcmp(&argv[1][5], "m244")) |
322 | modelnum = 131; | 324 | modelnum = 131; |
323 | else { | 325 | else { |