summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-09-25 15:35:39 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-09-25 15:35:39 +0000
commit2546bc59ccac97cc6ce8561761234cd1604b55c7 (patch)
treecbfc38008eff4f8b37a260633bf05dda79fb5432
parentaca6b9e91adcabf4b8dbb85d5674ffd42b82c0f0 (diff)
downloadrockbox-2546bc59ccac97cc6ce8561761234cd1604b55c7.tar.gz
rockbox-2546bc59ccac97cc6ce8561761234cd1604b55c7.zip
imx233/fuze+: add fuze+ to the simulator framework
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30602 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx233/adc-imx233.c2
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c1
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h4
-rw-r--r--firmware/target/hosted/sdl/sim-ui-defines.h8
-rw-r--r--uisimulator/bitmaps/UI-sansafuzeplus.bmpbin0 -> 773554 bytes
-rw-r--r--uisimulator/buttonmap/SOURCES2
-rw-r--r--uisimulator/buttonmap/sansa-fuze.c20
-rw-r--r--uisimulator/buttonmap/sansa-fuzeplus.c88
8 files changed, 111 insertions, 14 deletions
diff --git a/firmware/target/arm/imx233/adc-imx233.c b/firmware/target/arm/imx233/adc-imx233.c
index 4f183ac531..d0c4868ad3 100644
--- a/firmware/target/arm/imx233/adc-imx233.c
+++ b/firmware/target/arm/imx233/adc-imx233.c
@@ -22,6 +22,8 @@
22#include "config.h" 22#include "config.h"
23#include "adc.h" 23#include "adc.h"
24#include "adc-target.h" 24#include "adc-target.h"
25#include "system.h"
26#include "adc-imx233.h"
25 27
26/* dedicate two channels to temperature sensing 28/* dedicate two channels to temperature sensing
27 * dedicate channel 7 to battery 29 * dedicate channel 7 to battery
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c
index 8a99d19323..757ec72519 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c
@@ -19,6 +19,7 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "adc-target.h" 21#include "adc-target.h"
22#include "adc-imx233.h"
22 23
23int imx233_adc_mapping[] = 24int imx233_adc_mapping[] =
24{ 25{
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h
index ea0102d5c1..b7fa5edc86 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h
@@ -21,10 +21,6 @@
21#ifndef _ADC_TARGET_H_ 21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_ 22#define _ADC_TARGET_H_
23 23
24#include "system.h"
25#include "lradc-imx233.h"
26#include "adc-imx233.h"
27
28#define NUM_ADC_CHANNELS 4 24#define NUM_ADC_CHANNELS 4
29 25
30#define ADC_BATTERY 0 26#define ADC_BATTERY 0
diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h
index db777e7821..d76ef124bf 100644
--- a/firmware/target/hosted/sdl/sim-ui-defines.h
+++ b/firmware/target/hosted/sdl/sim-ui-defines.h
@@ -287,6 +287,14 @@
287#define UI_LCD_POSX 39 /* x position of lcd */ 287#define UI_LCD_POSX 39 /* x position of lcd */
288#define UI_LCD_POSY 38 /* y position of lcd */ 288#define UI_LCD_POSY 38 /* y position of lcd */
289 289
290#elif defined(SANSA_FUZEPLUS)
291#define UI_TITLE "Sansa Fuze+"
292#define UI_WIDTH 323 /* width of GUI window */
293#define UI_HEIGHT 595 /* height of GUI window */
294#define UI_LCD_POSX 44 /* x position of lcd */
295#define UI_LCD_POSY 47 /* y position of lcd */
296
297
290#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2) 298#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2)
291#ifdef SANSA_FUZE 299#ifdef SANSA_FUZE
292#define UI_TITLE "Sansa Fuze" 300#define UI_TITLE "Sansa Fuze"
diff --git a/uisimulator/bitmaps/UI-sansafuzeplus.bmp b/uisimulator/bitmaps/UI-sansafuzeplus.bmp
new file mode 100644
index 0000000000..e706f54905
--- /dev/null
+++ b/uisimulator/bitmaps/UI-sansafuzeplus.bmp
Binary files differ
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES
index c9955d408f..4a2c8ff2e1 100644
--- a/uisimulator/buttonmap/SOURCES
+++ b/uisimulator/buttonmap/SOURCES
@@ -65,5 +65,7 @@ pbell-vibe500.c
65mpio-hd200.c 65mpio-hd200.c
66#elif CONFIG_KEYPAD == MPIO_HD300_PAD 66#elif CONFIG_KEYPAD == MPIO_HD300_PAD
67mpio-hd300.c 67mpio-hd300.c
68#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
69sansa-fuzeplus.c
68#endif 70#endif
69#endif /* SIMULATOR */ 71#endif /* SIMULATOR */
diff --git a/uisimulator/buttonmap/sansa-fuze.c b/uisimulator/buttonmap/sansa-fuze.c
index fcd935946e..c6378c3d6c 100644
--- a/uisimulator/buttonmap/sansa-fuze.c
+++ b/uisimulator/buttonmap/sansa-fuze.c
@@ -77,15 +77,15 @@ int key_to_button(int keyboard_button)
77} 77}
78 78
79struct button_map bm[] = { 79struct button_map bm[] = {
80 { SDLK_KP8, 70, 265, 35, "Scroll Back" }, 80 { SDLK_KP7, 70, 400, 15, "Back" },
81 { SDLK_KP9, 141, 255, 31, "Play" }, 81 { SDLK_KP9, 258, 400, 15, "Play/Pause" },
82 { SDLK_KP_MULTIPLY, 228, 267, 18, "Home" }, 82 { SDLK_KP5, 162, 476, 15, "Select" },
83 { SDLK_LEFT, 69, 329, 31, "Left" }, 83 { SDLK_KP8, 162, 407, 35, "Up" },
84 { SDLK_SPACE, 141, 330, 20, "Select" }, 84 { SDLK_KP2, 162, 546, 35, "Down" },
85 { SDLK_RIGHT, 214, 331, 23, "Right" }, 85 { SDLK_KP6, 233, 546, 35, "Right" },
86 { SDLK_KP3, 142, 406, 30, "Menu" }, 86 { SDLK_KP4, 92, 476, 35, "Left" },
87 { SDLK_DOWN, 221, 384, 24, "Scroll Fwd" }, 87 { SDLK_KP_MINUS, 20, 190, 20, "Volume-" },
88 { SDLK_KP_MINUS, 270, 299, 25, "Power" }, 88 { SDLK_KP_PLUS, 20, 130, 20, "Volume+" },
89 { SDLK_h, 269, 358, 26, "Hold" }, 89 { SDLK_KP1, 160, 15, 15, "Power" },
90 { 0, 0, 0, 0, "None" } 90 { 0, 0, 0, 0, "None" }
91}; 91};
diff --git a/uisimulator/buttonmap/sansa-fuzeplus.c b/uisimulator/buttonmap/sansa-fuzeplus.c
new file mode 100644
index 0000000000..bd78274a03
--- /dev/null
+++ b/uisimulator/buttonmap/sansa-fuzeplus.c
@@ -0,0 +1,88 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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
23#include <SDL.h>
24#include "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32 case SDLK_KP4:
33 case SDLK_LEFT:
34 new_btn = BUTTON_LEFT;
35 break;
36 case SDLK_KP6:
37 case SDLK_RIGHT:
38 new_btn = BUTTON_RIGHT;
39 break;
40 case SDLK_KP8:
41 case SDLK_UP:
42 new_btn = BUTTON_UP;
43 break;
44 case SDLK_KP2:
45 case SDLK_DOWN:
46 new_btn = BUTTON_DOWN;
47 break;
48 case SDLK_PAGEUP:
49 case SDLK_KP9:
50 new_btn = BUTTON_PLAYPAUSE;
51 break;
52 case SDLK_INSERT:
53 case SDLK_KP7:
54 new_btn = BUTTON_BACK;
55 break;
56 case SDLK_KP5:
57 case SDLK_SPACE:
58 case SDLK_KP_ENTER:
59 case SDLK_RETURN:
60 new_btn = BUTTON_SELECT;
61 break;
62 case SDLK_KP_PLUS:
63 new_btn = BUTTON_VOL_UP;
64 break;
65 case SDLK_KP_MINUS:
66 new_btn = BUTTON_VOL_DOWN;
67 break;
68 case SDLK_HOME:
69 case SDLK_KP1:
70 new_btn = BUTTON_POWER;
71 break;
72 }
73 return new_btn;
74}
75
76struct button_map bm[] = {
77 { SDLK_KP8, 70, 265, 35, "Scroll Back" },
78 { SDLK_KP9, 141, 255, 31, "Play" },
79 { SDLK_KP_MULTIPLY, 228, 267, 18, "Home" },
80 { SDLK_LEFT, 69, 329, 31, "Left" },
81 { SDLK_SPACE, 141, 330, 20, "Select" },
82 { SDLK_RIGHT, 214, 331, 23, "Right" },
83 { SDLK_KP3, 142, 406, 30, "Menu" },
84 { SDLK_DOWN, 221, 384, 24, "Scroll Fwd" },
85 { SDLK_KP_MINUS, 270, 299, 25, "Power" },
86 { SDLK_h, 269, 358, 26, "Hold" },
87 { 0, 0, 0, 0, "None" }
88};