diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-03-09 23:32:37 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-03-09 23:32:37 +0000 |
commit | 935780e4260755b252cbd7d212aa3e9c0cde7db2 (patch) | |
tree | 4d5b0d40fc6619beadc42d426b5deaa6d89233f4 | |
parent | d33bff2b47bd30fe67a6ed963177f51ce156d5b7 (diff) | |
download | rockbox-935780e4260755b252cbd7d212aa3e9c0cde7db2.tar.gz rockbox-935780e4260755b252cbd7d212aa3e9c0cde7db2.zip |
Add support for Onda VX747 simulator (and yes, it needs a better picture)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20273 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/SOURCES | 6 | ||||
-rw-r--r-- | firmware/export/config-ondavx747.h | 9 | ||||
-rw-r--r-- | firmware/export/jz4740-codec.h | 4 | ||||
-rwxr-xr-x | uisimulator/sdl/UI-ondavx747.bmp | bin | 0 -> 613076 bytes | |||
-rw-r--r-- | uisimulator/sdl/button.c | 29 | ||||
-rw-r--r-- | uisimulator/sdl/uisdl.h | 6 |
6 files changed, 33 insertions, 21 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 05de8582cd..98569c4896 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1225,7 +1225,7 @@ drivers/qt1106.c | |||
1225 | #endif /* SIMULATOR */ | 1225 | #endif /* SIMULATOR */ |
1226 | #endif /* MEIZU_M3 */ | 1226 | #endif /* MEIZU_M3 */ |
1227 | 1227 | ||
1228 | #if CONFIG_CPU==JZ4732 | 1228 | #if CONFIG_CPU==JZ4732 && !defined(SIMULATOR) |
1229 | target/mips/ingenic_jz47xx/ata-nand-jz4740.c | 1229 | target/mips/ingenic_jz47xx/ata-nand-jz4740.c |
1230 | target/mips/ingenic_jz47xx/ata-sd-jz4740.c | 1230 | target/mips/ingenic_jz47xx/ata-sd-jz4740.c |
1231 | target/mips/ingenic_jz47xx/debug-jz4740.c | 1231 | target/mips/ingenic_jz47xx/debug-jz4740.c |
@@ -1241,7 +1241,7 @@ target/mips/ingenic_jz47xx/pcm-jz4740.c | |||
1241 | drivers/nand_id.c | 1241 | drivers/nand_id.c |
1242 | #endif | 1242 | #endif |
1243 | 1243 | ||
1244 | #if defined(ONDA_VX747) || defined(ONDA_VX747P) | 1244 | #if (defined(ONDA_VX747) || defined(ONDA_VX747P)) && !defined(SIMULATOR) |
1245 | target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c | 1245 | target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c |
1246 | target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c | 1246 | target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c |
1247 | target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c | 1247 | target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c |
@@ -1249,7 +1249,7 @@ target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c | |||
1249 | target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c | 1249 | target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c |
1250 | #endif | 1250 | #endif |
1251 | 1251 | ||
1252 | #ifdef ONDA_VX767 | 1252 | #if defined(ONDA_VX767) && !defined(SIMULATOR) |
1253 | target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c | 1253 | target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c |
1254 | target/mips/ingenic_jz47xx/onda_vx767/button-onda_vx767.c | 1254 | target/mips/ingenic_jz47xx/onda_vx767/button-onda_vx767.c |
1255 | target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c | 1255 | target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c |
diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h index ecc7994e11..f3bef714bd 100644 --- a/firmware/export/config-ondavx747.h +++ b/firmware/export/config-ondavx747.h | |||
@@ -113,9 +113,6 @@ | |||
113 | /* Define this if you have the Jz4740 internal codec */ | 113 | /* Define this if you have the Jz4740 internal codec */ |
114 | #define HAVE_JZ4740_CODEC | 114 | #define HAVE_JZ4740_CODEC |
115 | 115 | ||
116 | /* Define this if you have a speaker */ | ||
117 | #define HAVE_SPEAKER | ||
118 | |||
119 | /* define the bitmask of hardware sample rates */ | 116 | /* define the bitmask of hardware sample rates */ |
120 | #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \ | 117 | #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \ |
121 | SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16 | \ | 118 | SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16 | \ |
@@ -138,6 +135,8 @@ | |||
138 | /* Hardware controlled charging with monitoring */ | 135 | /* Hardware controlled charging with monitoring */ |
139 | #define CONFIG_CHARGING CHARGING_MONITOR | 136 | #define CONFIG_CHARGING CHARGING_MONITOR |
140 | 137 | ||
138 | #define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */ | ||
139 | |||
141 | #ifndef SIMULATOR | 140 | #ifndef SIMULATOR |
142 | 141 | ||
143 | /* Define this if you have a Ingenic JZ4732 */ | 142 | /* Define this if you have a Ingenic JZ4732 */ |
@@ -146,9 +145,11 @@ | |||
146 | /* define this if the hardware can be powered off while charging */ | 145 | /* define this if the hardware can be powered off while charging */ |
147 | #define HAVE_POWEROFF_WHILE_CHARGING | 146 | #define HAVE_POWEROFF_WHILE_CHARGING |
148 | 147 | ||
148 | /* Define this if you have a speaker */ | ||
149 | #define HAVE_SPEAKER | ||
150 | |||
149 | /* Define this to the CPU frequency */ | 151 | /* Define this to the CPU frequency */ |
150 | #define CPU_FREQ 336000000 /* CPU clock: 336 MHz */ | 152 | #define CPU_FREQ 336000000 /* CPU clock: 336 MHz */ |
151 | #define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */ | ||
152 | 153 | ||
153 | /* define this if you have a flash memory storage */ | 154 | /* define this if you have a flash memory storage */ |
154 | #define HAVE_FLASH_STORAGE | 155 | #define HAVE_FLASH_STORAGE |
diff --git a/firmware/export/jz4740-codec.h b/firmware/export/jz4740-codec.h index 5aab348635..e8751b5141 100644 --- a/firmware/export/jz4740-codec.h +++ b/firmware/export/jz4740-codec.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #define __JZ4740_CODEC_H_ | 22 | #define __JZ4740_CODEC_H_ |
23 | 23 | ||
24 | /* TODO */ | 24 | /* TODO */ |
25 | #define VOLUME_MIN -1 | 25 | #define VOLUME_MIN -730 |
26 | #define VOLUME_MAX 1 | 26 | #define VOLUME_MAX 60 |
27 | 27 | ||
28 | int tenthdb2master(int db); | 28 | int tenthdb2master(int db); |
29 | void audiohw_set_headphone_vol(int vol_l, int vol_r); | 29 | void audiohw_set_headphone_vol(int vol_l, int vol_r); |
diff --git a/uisimulator/sdl/UI-ondavx747.bmp b/uisimulator/sdl/UI-ondavx747.bmp new file mode 100755 index 0000000000..364003d720 --- /dev/null +++ b/uisimulator/sdl/UI-ondavx747.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 6402c75d55..c32c0a8c6a 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -34,16 +34,8 @@ | |||
34 | static intptr_t button_data; /* data value from last message dequeued */ | 34 | static intptr_t button_data; /* data value from last message dequeued */ |
35 | 35 | ||
36 | #ifdef HAVE_TOUCHSCREEN | 36 | #ifdef HAVE_TOUCHSCREEN |
37 | #include "touchscreen.h" | ||
37 | static int mouse_coords = 0; | 38 | static int mouse_coords = 0; |
38 | static enum touchscreen_mode touchscreen_mode = TOUCHSCREEN_POINT; | ||
39 | void touchscreen_set_mode(enum touchscreen_mode mode) | ||
40 | { | ||
41 | touchscreen_mode = mode; | ||
42 | } | ||
43 | enum touchscreen_mode touchscreen_get_mode(void) | ||
44 | { | ||
45 | return touchscreen_mode; | ||
46 | } | ||
47 | #endif | 39 | #endif |
48 | /* how long until repeat kicks in */ | 40 | /* how long until repeat kicks in */ |
49 | #define REPEAT_START 6 | 41 | #define REPEAT_START 6 |
@@ -124,7 +116,7 @@ void button_event(int key, bool pressed) | |||
124 | #ifdef HAVE_TOUCHSCREEN | 116 | #ifdef HAVE_TOUCHSCREEN |
125 | case BUTTON_TOUCHSCREEN: | 117 | case BUTTON_TOUCHSCREEN: |
126 | data = mouse_coords; | 118 | data = mouse_coords; |
127 | switch (touchscreen_mode) | 119 | switch (touchscreen_get_mode()) |
128 | { | 120 | { |
129 | case TOUCHSCREEN_POINT: | 121 | case TOUCHSCREEN_POINT: |
130 | new_btn = BUTTON_TOUCHSCREEN; | 122 | new_btn = BUTTON_TOUCHSCREEN; |
@@ -172,8 +164,8 @@ void button_event(int key, bool pressed) | |||
172 | case SDLK_F4: | 164 | case SDLK_F4: |
173 | if(pressed) | 165 | if(pressed) |
174 | { | 166 | { |
175 | touchscreen_mode = (touchscreen_mode == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); | 167 | touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); |
176 | printf("Touchscreen mode: %s\n", touchscreen_mode == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); | 168 | printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); |
177 | } | 169 | } |
178 | break; | 170 | break; |
179 | 171 | ||
@@ -1091,6 +1083,19 @@ void button_event(int key, bool pressed) | |||
1091 | case SDLK_KP_PLUS: | 1083 | case SDLK_KP_PLUS: |
1092 | new_btn = BUTTON_VIEW; | 1084 | new_btn = BUTTON_VIEW; |
1093 | break; | 1085 | break; |
1086 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | ||
1087 | case SDLK_ESCAPE: | ||
1088 | new_btn = BUTTON_POWER; | ||
1089 | break; | ||
1090 | case SDLK_KP_PLUS: | ||
1091 | new_btn = BUTTON_VOL_UP; | ||
1092 | break; | ||
1093 | case SDLK_KP_MINUS: | ||
1094 | new_btn = BUTTON_VOL_DOWN; | ||
1095 | break; | ||
1096 | case SDLK_KP_ENTER: | ||
1097 | new_btn = BUTTON_MENU; | ||
1098 | break; | ||
1094 | #else | 1099 | #else |
1095 | #error No keymap defined! | 1100 | #error No keymap defined! |
1096 | #endif /* CONFIG_KEYPAD */ | 1101 | #endif /* CONFIG_KEYPAD */ |
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index 6cb382ce8b..3868158938 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h | |||
@@ -291,6 +291,12 @@ | |||
291 | #define UI_LCD_POSX 42 /* x position of lcd */ | 291 | #define UI_LCD_POSX 42 /* x position of lcd */ |
292 | #define UI_LCD_POSY 55 /* y position of lcd */ | 292 | #define UI_LCD_POSY 55 /* y position of lcd */ |
293 | 293 | ||
294 | #elif defined(ONDA_VX747) | ||
295 | #define UI_TITLE "Onda VX747" | ||
296 | #define UI_WIDTH 340 /* width of GUI window */ | ||
297 | #define UI_HEIGHT 601 /* height of GUI window */ | ||
298 | #define UI_LCD_POSX 45 /* x position of lcd */ | ||
299 | #define UI_LCD_POSY 90 /* y position of lcd */ | ||
294 | 300 | ||
295 | #else | 301 | #else |
296 | #error no UI defines | 302 | #error no UI defines |