From 935780e4260755b252cbd7d212aa3e9c0cde7db2 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Mon, 9 Mar 2009 23:32:37 +0000 Subject: 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 --- firmware/SOURCES | 6 +++--- firmware/export/config-ondavx747.h | 9 +++++---- firmware/export/jz4740-codec.h | 4 ++-- uisimulator/sdl/UI-ondavx747.bmp | Bin 0 -> 613076 bytes uisimulator/sdl/button.c | 29 +++++++++++++++++------------ uisimulator/sdl/uisdl.h | 6 ++++++ 6 files changed, 33 insertions(+), 21 deletions(-) create mode 100755 uisimulator/sdl/UI-ondavx747.bmp 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 #endif /* SIMULATOR */ #endif /* MEIZU_M3 */ -#if CONFIG_CPU==JZ4732 +#if CONFIG_CPU==JZ4732 && !defined(SIMULATOR) target/mips/ingenic_jz47xx/ata-nand-jz4740.c target/mips/ingenic_jz47xx/ata-sd-jz4740.c target/mips/ingenic_jz47xx/debug-jz4740.c @@ -1241,7 +1241,7 @@ target/mips/ingenic_jz47xx/pcm-jz4740.c drivers/nand_id.c #endif -#if defined(ONDA_VX747) || defined(ONDA_VX747P) +#if (defined(ONDA_VX747) || defined(ONDA_VX747P)) && !defined(SIMULATOR) target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c @@ -1249,7 +1249,7 @@ target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c #endif -#ifdef ONDA_VX767 +#if defined(ONDA_VX767) && !defined(SIMULATOR) target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c target/mips/ingenic_jz47xx/onda_vx767/button-onda_vx767.c 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 @@ /* Define this if you have the Jz4740 internal codec */ #define HAVE_JZ4740_CODEC -/* Define this if you have a speaker */ -#define HAVE_SPEAKER - /* define the bitmask of hardware sample rates */ #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \ SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16 | \ @@ -138,6 +135,8 @@ /* Hardware controlled charging with monitoring */ #define CONFIG_CHARGING CHARGING_MONITOR +#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */ + #ifndef SIMULATOR /* Define this if you have a Ingenic JZ4732 */ @@ -146,9 +145,11 @@ /* define this if the hardware can be powered off while charging */ #define HAVE_POWEROFF_WHILE_CHARGING +/* Define this if you have a speaker */ +#define HAVE_SPEAKER + /* Define this to the CPU frequency */ #define CPU_FREQ 336000000 /* CPU clock: 336 MHz */ -#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */ /* define this if you have a flash memory storage */ #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 @@ #define __JZ4740_CODEC_H_ /* TODO */ -#define VOLUME_MIN -1 -#define VOLUME_MAX 1 +#define VOLUME_MIN -730 +#define VOLUME_MAX 60 int tenthdb2master(int db); 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 Binary files /dev/null and b/uisimulator/sdl/UI-ondavx747.bmp 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 @@ static intptr_t button_data; /* data value from last message dequeued */ #ifdef HAVE_TOUCHSCREEN +#include "touchscreen.h" static int mouse_coords = 0; -static enum touchscreen_mode touchscreen_mode = TOUCHSCREEN_POINT; -void touchscreen_set_mode(enum touchscreen_mode mode) -{ - touchscreen_mode = mode; -} -enum touchscreen_mode touchscreen_get_mode(void) -{ - return touchscreen_mode; -} #endif /* how long until repeat kicks in */ #define REPEAT_START 6 @@ -124,7 +116,7 @@ void button_event(int key, bool pressed) #ifdef HAVE_TOUCHSCREEN case BUTTON_TOUCHSCREEN: data = mouse_coords; - switch (touchscreen_mode) + switch (touchscreen_get_mode()) { case TOUCHSCREEN_POINT: new_btn = BUTTON_TOUCHSCREEN; @@ -172,8 +164,8 @@ void button_event(int key, bool pressed) case SDLK_F4: if(pressed) { - touchscreen_mode = (touchscreen_mode == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); - printf("Touchscreen mode: %s\n", touchscreen_mode == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); + touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); + printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); } break; @@ -1091,6 +1083,19 @@ void button_event(int key, bool pressed) case SDLK_KP_PLUS: new_btn = BUTTON_VIEW; break; +#elif CONFIG_KEYPAD == ONDAVX747_PAD + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; + case SDLK_KP_PLUS: + new_btn = BUTTON_VOL_UP; + break; + case SDLK_KP_MINUS: + new_btn = BUTTON_VOL_DOWN; + break; + case SDLK_KP_ENTER: + new_btn = BUTTON_MENU; + break; #else #error No keymap defined! #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 @@ #define UI_LCD_POSX 42 /* x position of lcd */ #define UI_LCD_POSY 55 /* y position of lcd */ +#elif defined(ONDA_VX747) +#define UI_TITLE "Onda VX747" +#define UI_WIDTH 340 /* width of GUI window */ +#define UI_HEIGHT 601 /* height of GUI window */ +#define UI_LCD_POSX 45 /* x position of lcd */ +#define UI_LCD_POSY 90 /* y position of lcd */ #else #error no UI defines -- cgit v1.2.3